Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
?
Python Help?
I need to define a variable by the contents of a string.
Here's what I need:
NeededVariable = [dir.something['test']]
I have to assemble the contents on the right side for batch processing. So basically I have:
String = "[dir.something['test']]"
But when I try to set NeededVariable=String it obviously turns NeededVariable into a string
NeededVariable = String
Returns:
NeededVariable = "[dir.something['test']]"
So basically I need that but without the quotations on the outside.
Here's an idea I had:
print returns the value without the quotations. Is there a way to set a variable equal to the returned value of print?
Needed variable = print string
1 AnswerProgramming & Design3 years agoWhat kind or car is this?
Couldn't find many pictures. Hope you can help me out. I am just curious.
Thanks
2 AnswersOther - Car Makes7 years ago