We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,397 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

ubuntu Launcher

How can I start a launcher from python?
if I do: os.system("~/localhost") it just returns a number (probably a process id or something)

if this is not possible, how can I start from python a terminal window
and execute a code in that terminal?
(without closing the python script)

Thanks in advance =)

2
Contributors
3
Replies
1 Day
Discussion Span
3 Years Ago
Last Updated
4
Views
Question
Answered
Kruptein
Posting Whiz in Training
258 posts since Sep 2009
Reputation Points: 25
Solved Threads: 11
Skill Endorsements: 0

I found out the launcher is actually called: localhost.desktop
but if I do: os.system("~/localhost.desktop") it just starts my standard editor and shows the script...

Kruptein
Posting Whiz in Training
258 posts since Sep 2009
Reputation Points: 25
Solved Threads: 11
Skill Endorsements: 0

I found out the launcher is actually called: localhost.desktop
but if I do: os.system("~/localhost.desktop") it just starts my standard editor and shows the script...

I don't know ubuntu very well, but if your launcher is related to a bash script, the script must be somewhere in the filesystem, so locate the script and call os.system(path_to_script) or subprocess.Popen(["bash", path_to_script]) .

Gribouillis
Posting Maven
Moderator
3,101 posts since Jul 2008
Reputation Points: 1,130
Solved Threads: 761
Skill Endorsements: 11

well I found out,
it had to be: os.system("xterm ~/localhost.desktop")

Kruptein
Posting Whiz in Training
258 posts since Sep 2009
Reputation Points: 25
Solved Threads: 11
Skill Endorsements: 0
Question Answered as of 3 Years Ago by Gribouillis

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0681 seconds using 2.66MB