![]() |
Combining strings for os.system()
Not working too well >_>
:
import osOutput is: 'C:\Program\' is not recognized as an internal or external command, operable program or batch file. Works right till then, how do I make the space in the string work? |
Bleh, nevermind. I turned to VB (lol) and got a working GUI program for it
|
:
full = gunzrun + game + eq + map + eqThat's what you want. |
Oh wow, thanks. I'd have never realized it, teehee
|
You should use os.path.join for this task to make your code (more) portable.
You should also use a Popen object from the subprocess module rather than os.system for the same reason. You could also, as a matter of preference, prepend your paths with r to create raw strings so that you don't have to escape backslashes (unless the last character in the string is a backslash, in which case it must be escaped). |
Since the Python code is running an exe file, I doubt portability matters.
|
C++ code runs in an exe file, so I suppose portability doesn't matter there, either?
|
You suppose right. Portability doesn't matter with an .exe file -- it's generally already blown to hell and gone. Portability is primarily a source code phenomenon. What good is a highly portable adjunct that runs completely non-portable code, regardless of the executive mechanism?
|
"The good" is that it's easy to compile the source code to formats that will run on other systems. It may not matter at present, but if a port becomes desirable in the future, the code won't need to be rewritten.
Besides, it's good practice; why not use deprecated functions if doing so will have no effect on the compiled executable? |
I'm glad you 'splained that fer me. :beard:
|
| All times are GMT -5. The time now is 10:19 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC