Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 22nd, 2005, 5:45 PM   #1
SaturN
Programmer
 
Join Date: Apr 2005
Location: Uk
Posts: 68
Rep Power: 4 SaturN is on a distinguished road
Question Looked, But Can't find!! Opening Programs With Python

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)
SaturN is offline   Reply With Quote
Old Jun 22nd, 2005, 6:16 PM   #2
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
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
uman is offline   Reply With Quote
Old Jun 22nd, 2005, 6:48 PM   #3
SaturN
Programmer
 
Join Date: Apr 2005
Location: Uk
Posts: 68
Rep Power: 4 SaturN is on a distinguished road
Thanks for that
__________________
while me is alive:
	make(life,simple)
SaturN is offline   Reply With Quote
Old Jun 22nd, 2005, 9:19 PM   #4
uman
Expert Programmer
 
Join Date: Dec 2004
Posts: 794
Rep Power: 4 uman is on a distinguished road
No problem.
__________________
Few people deserve to be compared to (Rush) Limbaugh, most of them were convicted at the Nuremburg trials.
--WilliamSChips on Slashdot
uman is offline   Reply With Quote
Old Jun 23rd, 2005, 6:24 PM   #5
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
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"])
Cerulean is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:12 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC