From: Neil H. <ne...@nk...> - 2007-02-19 18:39:29
|
On 19/02/2007 16:49, DOUTCH GARETH-GDO003 wrote: > Here's the java alternative: > >>From java.lang import Runtime > R = Runtime.getRuntime() > R.exec('"C:/Program Files/Mozilla Firefox/firefox.exe" www.jython.org') > > Works. But os.system still seems buggy. Sourceforge won't let me download 2.2b at the moment, but 2.1 is also failing and the problem seems to be because os.system is building a list with the shell command prepended and passing it onto exec(). So it's running the equivalent of R.exec(['cmd','/c','"C:/Program Files/Mozilla Firefox/firefox.exe" www.google.com']) which fails, whereas: R.exec(['cmd','/c','C:/Program Files/Mozilla Firefox/firefox.exe','www.google.com']) works fine. Unfortunately I can't get my brain around how to generate the last list of strings through the os.system() call. Possibly 2.2b has the same problem. -- Neil Hughes |