|
From: Kevin A. <al...@se...> - 2002-01-03 20:49:19
|
There is at least one user that gets a lockup when trying to launch a sample
while using the samples.py script under Windows 98. He is using Python 2.1.1
and wxPython 2.3.2.1. I can't reproduce the problem on my Win98 box and I've
never seen this problem under Windows 2000 either. He does not have any
problems running any of the samples from the command-line or double-clicking
to launch them from the Explorer.
He has the same problem with the Run command in the resourceEditor and when
double-clicking a grep result line in the findfiles sample, which attempts
to open the grep result file with textEditor.py. Those scripts use popen
under Windows just like the samples.py script.
The code in samples.py that does the work is shown below.
The popen call is probably the culprit since that is where the lockup
occurs, but I don't know enough about the internals of popen to know why. If
somebody else is having the same problem, at least we can try and isolate
the issue.
ka
---
def on_btnLaunch_mouseClick(self, menu, event):
name = self.components.listSamples.selected
if name == "samples":
path = ""
else:
path = name
if os.path.exists(os.path.join(path, name + ".pyw")):
filename = os.path.join(path, name + ".pyw")
python = os.path.join(os.path.dirname(sys.executable),
'pythonw.exe')
else:
filename = os.path.join(path, name + ".py")
python = sys.executable
args = self.getCommandLineArgs()
if sys.platform[:3]=='win':
os.popen('start ' + python + ' ' + filename + args)
else:
os.system(python + ' ' + filename + args)
|