![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Apr 2005
Location: Uk
Posts: 68
Rep Power: 4
![]() |
I have looked through the threads, i may have missed it, but i swear that i saw it on here before?? I promise.. hehe
What i want, is to get python to open a certain program!! If anyone can give me the link to the thread, or an idea of where i can find out!!
__________________
while me is alive: make(life,simple) |
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
import os
os.system("name of program in your path")
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials. --WilliamSChips on Slashdot |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Apr 2005
Location: Uk
Posts: 68
Rep Power: 4
![]() |
Thanks for that
__________________
while me is alive: make(life,simple) |
|
|
|
|
|
#4 |
|
Expert Programmer
Join Date: Dec 2004
Posts: 794
Rep Power: 4
![]() |
No problem.
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials. --WilliamSChips on Slashdot |
|
|
|
|
|
#5 |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Be careful of the security implications of using os.system or any other process-spawning method in the os module that takes a string if you're passing user input on as parameters or something. You don't want to give the user of the script access to a shell, do you?
And you're better off using the subprocess module if you're using Python 2.4: import subprocess subprocess.call(["program-name", "--param1", "--param2"]) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|