run runs away

Discussion in 'Python' started by Nx, Nov 29, 2005.

  1. Nx

    Nx Guest

    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
     
    Nx, Nov 29, 2005
    #1
    1. Advertising

  2. "Nx" wrote:

    > 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" ?

    >>> run("python2.4", "dbviewmaster.py")

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

    </F>
     
    Fredrik Lundh, Nov 29, 2005
    #2
    1. Advertising

  3. Nx

    Guest

    "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-----
     
    , Nov 29, 2005
    #3
  4. Nx

    Nx Guest

    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
     
    Nx, Nov 30, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. msnews.microsoft.com

    Run away SPIDs to ASPState database

    msnews.microsoft.com, May 17, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    421
    msnews.microsoft.com
    May 17, 2006
  2. Ollie
    Replies:
    0
    Views:
    380
    Ollie
    Oct 2, 2003
  3. Replies:
    0
    Views:
    335
  4. Jp Calderone
    Replies:
    1
    Views:
    330
  5. windandwaves

    onclick runs straight away....

    windandwaves, Feb 18, 2006, in forum: Javascript
    Replies:
    2
    Views:
    136
    windandwaves
    Feb 20, 2006
Loading...

Share This Page