starting other programs from within python

hejduk claxtonr at beer.com
Tue Jul 16 17:11:56 EDT 2002


Hi, I'm writing a small menu like application that I plan to have sitting
on my desktop that I want to use to allow myself easy access to certain
apllications. My problem has been finding the best way to start up an
outside application from within python. Right now I'm using threads in
the following manner:

I obtain the path and then send it to the following function:

def progStart(file):
      import thread
      from os import system

      def progStart(file):
          system(file)

      thread.start_new_thread(progStart, (file,))

However, when I monitor the memory usage of the interpreter it appears
that when this outside application is closed that not all the memory resource is
returned, ie:

before: 7248 k
during: 18624 k
after:  12284 k

I'm wondering if this is a problem, or whether the resources will be freed
when there needed? If the outside app is another python program will
another instance of the interpreter be started? In general what is the
best way to start outside applications from something like my menu
program?

Thanks,



More information about the Python-list mailing list