阅读背景:

寻找一种在脚本中识别和替换Python变量的方法

来源:互联网 

I have a dictionary of variablenames and I want those to be the variablenames in another script. So I probably need to identify all variables in a Python script and then somehow replace those with the desired ones from the dictionary. Yet I cannot figure out what might be the most elegant way to do that. Do I have to paste the one script as a string to the other script that does the replacement? Any tips? Thanks Edit: The actual question is not to request a complete solution rather than asking whether there is a possibility to identify which word in a script is actually a variable. Is it possible to find these eg compare them to PythonBuiltIn variables?!I have a dictionary of variablenames and I want




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: