[Tutor] Possible problems using a windows .bat file to run a program?
D-Man
dsh8290@rit.edu
Thu, 12 Apr 2001 17:16:44 -0400
On Thu, Apr 12, 2001 at 01:47:36PM -0700, folklore hopeful wrote:
| I was wondering if there are any potential problems in using a
| windows desktop shortcut to run a batch file which runs a python
| program. Basically, I have a nifty little program that is useful in
| the office, but the people using the program are computer-challanged
| and the word "DOS" sounds confusing to them. So, currently, I am
| having them double click on a batchfile which runs:
The python installer sets the file associations so that they can
double click on a .py or .pyw file and it will run in python. The
biggest problem with that is getting a traceback, and windows closing
the DOS-box before the message can be read.
| I've had reports of the program giving error messages and etc. and
| that computers had to be rebooted so that the program would work.
| Any ideas what the problem might be?
Windows <wink>
| How can I avoid this?
Use Debian <wink>. apt-get rules. No rebooting necessary except for
power outages, new kernels, or testing boot loaders and init sequence
<grin>.
Seriously, though, windows is _very_ reboot-happy. (Ever try to set
up networking? Each change requires a reboot! =p) After installing
anything (apps, drivers, you name it) windows must be rebooted to work
semi-reliably. (IMO windows doesn't work any better than
semi-reliably)
Another potential solution would be to put a
raw_input( "Press [enter] to quit this app" )
at the end of your program so that error messages (the DOS-box) will
stay on-screen until you can read them. Without knowing the actual
error message it is hard to guess what the real problem is.
Is your program a console or gui app? If it is a gui app then you
might want to rename the main .py file to .pyw to eliminate the DOS
box.
-D