473,325 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Re: Spawning a new UI process

Ed Leafe wrote:
I'm working on a wxPython app (well, a Dabo app, but it's basically
the same thing) that presents the user with a selection of several
wxPython apps that exist on their system. They choose one, and I want to
then "launch" that app, as if they had typed "python myapp.py" from a
terminal window. The initial app can either terminate or continue;
that's not terribly important. The important thing is to get the
selected app to run in a separate process.

I've tried all the variants of os.spawn* and os.exec*, without
success. Either nothing happens, or a Python interpreter is opened in
the Terminal window I used to run the launcher. I want to do something
like:

cd (appdir)
pth = os.path.join(os.getcwd(), "main.py")

followed by one of:

os.spawnl(os.P_NOWAIT, "main.py")
os.spawnl(os.P_NOWAIT, pth)
os.spawnl(os.P_NOWAIT, "python", pth)
os.spawnl(os.P_NOWAIT, "python", "main.py")
os.spawnl(os.P_NOWAIT, "/usr/bin/python", pth)
os.spawnl(os.P_NOWAIT, "/usr/bin/python", "main.py")

The only result I've gotten is a Python interpreter is started, but
the GUI app that should be launched by 'main.py' is never run.

So what am I missing? How do I launch a python app in a separate
process from another Python app?
Ed! Good to see you on c.l.py!

a) Try using the subprocess module
b) Use *.pyw programs to ensure no console window is created.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Nov 9 '08 #1
0 1388

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: brolewis | last post by:
I am writing a program on Windows (XP Pro) that as part of the application takes advantage of rsync's ability to synchronize a client and server computer. However, because of the nature of our...
2
by: Dave Kirby | last post by:
I am working on a network management program written in python that has multiple threads (typically 20+) spawning subprocesses which are used to communicate with other systems on the network. This...
1
by: Russ Green | last post by:
I hav previosuly had VB.NET 2003 Standard installed on my machine and it works great. Yesterday I installed C++.NET 2003 Standard and starting playing with it. Hardly surprisingly it also worked...
1
by: Sanjay Kedare | last post by:
Hi, How safe it is to spawn a thread to do some routine job from Application_Start event of ASP.NET Also whenever the ASPNET worker process restarts, will the Application_Start event be...
4
by: Marianne | last post by:
Had 1.1 configured so that a process I was launching on a web server would have access to a domain controller in a different domain. This was accomplished by setting the <processModel> tag in...
7
by: kris_scheyer | last post by:
Hi, I have a little .exe file that I want the C# code behind of my web application to execute as a different user. The executable is supposed to take a screenshot of the server's display and...
5
by: Jeremy | last post by:
I have a core VB service that monitors a database, and based on data in the records will execute code to send email notifications. Problem: I don't want my main program code to halt and wait for...
2
by: Remulac | last post by:
I'm trying to execute a DOS program from within VB.NET. Of course, I used to simply use Shell(), but that doesn't seem to work even when I import the VisualBasic namespace. Here's the code I'm...
6
by: jobs | last post by:
Im writing an SSIS script task using VB.NET. I'd like to be able to initiate an oracle stored procedure call for a process that will run for 8 hours, but I don't want my process to wait for it...
12
by: bhunter | last post by:
Hi, I've used subprocess with 2.4 several times to execute a process, wait for it to finish, and then look at its output. Now I want to spawn the process separately, later check to see if it's...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.