can I run a .py file using a button in wxpython?
Of course. You will probably want to use Python’s subprocess module to execute it inside the button’s event handler method.
- Mike
···
On Friday, February 28, 2014 5:30:51 AM UTC-6, sabrina chandan wrote:
can I run a .py file using a button in wxpython?
Depending on what you are trying to do, it could be very simple.
I am using Windows, I don’t know if these all work under Linux or OSX.
For my purposes, I wanted to create a simple “Launch” program
for a bunch of Windows files for programs I used often, but the Windows
task bar or start menu just didn’t cut it (e.g. if I wanted to call
a command line with argument).
For this I use:
import os
and use a sequence of one or more of the following:
os.chdir(…) # make sure I’m in the directory Windows would like to be.
os.startfile(…) # to automatically run registered types, also good for firing up default web browser with URL
os.system(…) # give a cmd command line command
Rufus
···
On Friday, February 28, 2014 6:30:51 AM UTC-5, sabrina chandan wrote:
can I run a .py file using a button in wxpython?