From: Phil E. <ph...@li...> - 2006-04-12 13:17:43
|
Hi All: Coming from a Linux background, I'm struggling to understand some of the things that appear to be going on behind the scenes when I'm coding stuff to run under Windows XP. The application in question has a textfield containing the name of a Python source code file and an 'Edit...' button next to it. When I click the button, I'm running this code: def on_mainScriptEditBtn_mouseClick(self, event): editor = self.cfg.get('ConfigData', 'codeeditor') item = self.pathJoin(self.components.mainScript.text) item = os.path.join(self.components.baseDir.text, item) item = os.path.join(self.cfg.get('ConfigData', 'projects'), item) if sys.platform.startswith('win'): editor = GetShortPathName(editor) item = GetShortPathName(item) print editor + ' ' + item os.system(editor + ' ' + item) When the code runs, it prints out what I'm expecting, namely that I'm trying to run the Pythoncard code editor with the name of a script file as the only parameter on the command line. I then get the standard 'windows cannot open this file' dialog box and I get to tell Windows that I want codeEditor.py to be opened using the program called 'python'. The codeEditor duly opens up, but it seems as though Windows is somehow losing my command line parameter and all I end up with is a blank codeEditor window, instead of it opening the file I wanted it to. Adding a simple 'print sys.argv' to the top of the codeEditor proves that this is the case. Could somebody please explain to a dumb UNIX user what vital piece of information I'm missing in order to make this work? -- Regards Phil Edwards Brighton, UK |