User Profile
Collapse
-
I just want to access the variables. I do not need to run it. -
In my situation I can not use import because import does not work within the module mystuff() which is why I'm trying to get execfile() to work. It is my understanding that it should work in a function like mystuff().
I have another larger program that I'm trying to get to work by using execfile(). This program is a record and playback type of program using serial communication. I have several folders that contains a setup file for configuring...Leave a comment:
-
Need help with execfile()
I'm trying to use execfile() in a Python program, but I do not know why it works in one situation and not work in another. I'm really new to Python and so I do not have enough experience to figure this out. Plus I'm not a programmer.
In this situation, it does not work:
#file1.py
mynums=[1,2,3]
#file2.py
def mystuff():
<tab>execfile(' file1.py')
<tab>print mynums
mystuff()...
No activity results to display
Show More
Leave a comment: