run runs away

N

Nx

Hello

I think my question is how to make
the script wait until it returns from a call to run()


Here is a code snippet:

# next lines calls python2.4 32 bit version
# from a script running in python2.3 64 bit version
run("python2.4", "dbviewmaster.py")
# I want the following only to run after
# running of python2.4 has finished
self.textBrowser1.reload
f = open(self.DBMETA,'r')
for self.getline in f.readlines():
self.textBrowser1.append(self.getline)
f.close()



Thanks for any hints how to do that.
Nx
 
F

Fredrik Lundh

Nx said:
Here is a code snippet:

# next lines calls python2.4 32 bit version
# from a script running in python2.3 64 bit version
run("python2.4", "dbviewmaster.py")
# I want the following only to run after
# running of python2.4 has finished
self.textBrowser1.reload
f = open(self.DBMETA,'r')
for self.getline in f.readlines():
self.textBrowser1.append(self.getline)
f.close()

Thanks for any hints how to do that.

what's "run" ?
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'run' is not defined

</F>
 
J

jepler

"run" is not the name of a Python built-in function. That leaves
everyone but you somewhat in the dark about why it does or does not wait
for the created process to complete.

If you want a function that starts a new process and waits for it to
complete, you probably want to use os.spawnv(os.P_WAIT, ...).

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDjHRGJd01MZaTXX0RAnIBAJ0c9YQ5tH2SWBhFXUSqbFNpknh56ACffC7a
6c3NOMZizEHbgLwxwXiPSic=
=8oy3
-----END PGP SIGNATURE-----
 
N

Nx

Thanks for your reply !

I now realize , that the run() used in this
code stems from a def , which actually wraps
os.spawnv(os.P_WAIT, ...) in
a way that eliminates waiting....

I like this newsgroup as there are always
people who are less stumped than oneself.

Nx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top