I need to get all the variables in a python program, but I am not allowed to run the program. I can however run it by calling it from a main program and analyze the local variables.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
astis your friend. It allows you to take advantage of the actual Python parser, but not actually execute the parsed code.That said, this will only give you a first-order approximation – since Python allows dynamic creation of variables, static analysis can’t predict 100% of all variable creation.