Re: launch a .py file from a batch file
- From: Dave Angel <davea@xxxxxxxx>
- Date: Tue, 23 Jun 2009 09:21:01 -0400
Paul Moore wrote:
2009/6/23 C M <cmpython@xxxxxxxxx>:CM - Paul is right. If you have to use quotes, then you also need the extra argument to hold the "title" for the command window that won't be created. Stupid syntax on "Start.exe". I seldom hit that because I try not to put anything in a directory with spaces in it, like "Program Files" or "Documents and Settings"
Assuming you're running on Windows XP, try the following line in yourWell, I renamed my script to have a .pyw extension, and then ran the line
batch file:
@start path\MyPythonApp.pyw
That's of course after you rename your script to a pyw extension. That's
associated with pythonw, which doesn't need a command window.
above. Without quotes, it doesn't find it (because I have spaces in the
path).
With quotes it just opens a console and does nothing (does not launch the
app).
Any ideas?
Use
@start "" "path\MyPythonApp.pyw"
The first item in quotes is the window title. If you only include the
path (in quotes) it's taken as a title, which is why you need the
second set of quotes.
Paul.
I have uncovered dozens of bugs in other people's programs over the years that were triggered by spaces in the pathname. It's not so bad now, but still can bite you.
.
- References:
- launch a .py file from a batch file
- From: CM
- launch a .py file from a batch file
- Prev by Date: Authenticating to web service using https and client certificate
- Next by Date: C-extension 2 times slower than exe
- Previous by thread: Re: launch a .py file from a batch file
- Next by thread: re.NONE
- Index(es):
Relevant Pages
|