wx python

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

wx python

sabrina chandan
can I run a .py file using a button in wxpython?

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: wx python

Mike Driscoll


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?

Of course. You will probably want to use Python's subprocess module to execute it inside the button's event handler method.

- Mike

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: wx python

Rufus V. Smith
In reply to this post by sabrina chandan
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?

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.