Discussion:
wx.py.shell
kruvva
2014-10-23 04:37:59 UTC
Permalink
Hello All,

I added a wx.py.shell in my application and I can call/execute my functions
within this shell. For example, I can call functions like read(address1),
write(address2, data) at the shell prompt one after other. They work fine.

Now I want to place a set of these function calls in a file, named
myscripts.py, and execute them once in this shell. How do I do this? When I
tried importing this file to execute those functions, it throws error like
"NameError: name 'readd' is not defined". I want to know if there is way
to execute all the functions like a script.

Thanks
Kotesh
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nathan McCorkle
2014-10-23 18:16:26 UTC
Permalink
if you put a function 'zoomzoom(some_arg)' in myFile.py... then you import
myFile... you call it with myFile.zoomzoom(some_param)
Post by kruvva
Hello All,
I added a wx.py.shell in my application and I can call/execute my
functions within this shell. For example, I can call functions like
read(address1), write(address2, data) at the shell prompt one after other.
They work fine.
Now I want to place a set of these function calls in a file, named
myscripts.py, and execute them once in this shell. How do I do this? When I
tried importing this file to execute those functions, it throws error like
"NameError: name 'readd' is not defined". I want to know if there is way
to execute all the functions like a script.
Thanks
Kotesh
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
kruvva
2014-10-23 19:37:19 UTC
Permalink
I found the solution using execfile('myscripts.py). All the functions
within the file are executed. Thank you.
Post by Nathan McCorkle
if you put a function 'zoomzoom(some_arg)' in myFile.py... then you import
myFile... you call it with myFile.zoomzoom(some_param)
Post by kruvva
Hello All,
I added a wx.py.shell in my application and I can call/execute my
functions within this shell. For example, I can call functions like
read(address1), write(address2, data) at the shell prompt one after other.
They work fine.
Now I want to place a set of these function calls in a file, named
myscripts.py, and execute them once in this shell. How do I do this? When I
tried importing this file to execute those functions, it throws error like
"NameError: name 'readd' is not defined". I want to know if there is way
to execute all the functions like a script.
Thanks
Kotesh
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...