Menu
Horje
Hi !
Welcome,
Guest
Close Menu
Home
Coding
Code Example
Download
Home
Coding
Code Example
Python class get attribute by name Code Example
python class get attribute by name
>>> class c: pass o = c() >>> setattr(o, "foo", "bar") >>> o.foo 'bar' >>> getattr(o, "foo") 'bar'
Source:
stackoverflow.com
Next
Previous
Python
Related
how to maker loops coun t in second in pytho Code Example
DJANGO rest framework GET POST Code Example
python alfabet Code Example
python program to print list vertically without using loop Code Example
django session expire time Code Example
Type
:
Code Example
Category
:
Coding
Sub Category
:
Code Example
Uploaded by
:
Admin
Views
:
8