From: Ruben M. <rmc...@ya...> - 2006-04-18 13:56:07
|
Phil, You probably found the answer to this issue by now, but just in case you haven't here is a tip. Check your quotes. See here for an interesting sample. http://jason.diamond.name/weblog/2005/04/14/dont-quote-me-on-this -Ruben --- Phil Edwards <ph...@li...> wrote: > 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 > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a > groundbreaking scripting language > that extends applications into web and mobile media. > Attend the live webcast > and join the prime developer group breaking into > this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |