![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Quote:
os.system("program-name")If you just want to open an application you don't want os.startfile on Windows at all, as that loads the given file in the application that is associated with it (by default notepad for a .txt file, Windows image viewer for .jpg, etc). Probably not what you wanted. |
|
|
|
|
|
|
#12 | |
|
Newbie
Join Date: Jun 2006
Location: In a box
Posts: 27
Rep Power: 0
![]() |
Quote:
__________________
~ Silicon Enhanced Pudding "It's magically delicious" |
|
|
|
|
|
|
#13 |
|
Programming Guru
![]() ![]() |
Like I said in my post, os.system executes a system command. So whatever you would type in to the command prompt is what you would use here. I believe in linux, it is the application followed by the filename.
Example: nano my_script.py versus python my_script.py |
|
|
|
|
|
#14 |
|
Expert Programmer
|
You could use this code to call os.startfile if it exists on your system, or else call os.system with a specific program to open the file.
import os
if 'startfile' in dir(os):
os.startfile("/path/to/file")
else:
os.system("program /path/to/file") |
|
|
|
|
|
#15 |
|
Programming Guru
![]() ![]() |
Isn't that what I've said twice now? Am I just being confirmed... or ignored? =S !
(Well, I guess yours is a bit different because it actually runs in there, fists raised, looking for the function.) |
|
|
|
|
|
#16 | |
|
Newbie
Join Date: Jun 2006
Location: In a box
Posts: 27
Rep Power: 0
![]() |
Quote:
__________________
~ Silicon Enhanced Pudding "It's magically delicious" |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|