Sep-30-2022, 08:25 AM
Hello,
I am kinda a beginner in python..
You might say that I have not been 'googling' for this question..
But..
I write code
They just use value of a variable as a name for another variable and assign to it some meaning.
What I want to do
I do not want to assign another meaning to that value of a string, I want to use value of a string as a NAME for variable. For example if:
Rokas
I am kinda a beginner in python..
You might say that I have not been 'googling' for this question..
But..
I write code
for atr in dir(attributes['pDevMode']): print(atr, ': ',attributes['pDevMode'].atr)I get error
Traceback (most recent call last): File "C:\Users\rokas\Desktop\Codin\Automatic printer selector\test.py", line 16, in <module> print(atr, ': ',attributes['pDevMode'].atr) AttributeError: 'PyDEVMODEW' object has no attribute 'atr'What I think I have found on internet so far
They just use value of a variable as a name for another variable and assign to it some meaning.
What I want to do
I do not want to assign another meaning to that value of a string, I want to use value of a string as a NAME for variable. For example if:
atr = 'PaperSize', I want that my line would correspond to
print(atr, ': ',attributes['pDevMode'].PaperSize)Sincerely,
Rokas