create python process

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ajikoe@gmail.com

    #1

    create python process

    Hello,

    I would like to create python processes instead of thread.
    Can anyone give me an example or site which shows a tutorial about how
    to create processes ?

    Sincerely Yours,
    Pujo

  • Mike Meyer

    #2
    Re: create python process

    "ajikoe@gmail.c om" <ajikoe@gmail.c om> writes:
    [color=blue]
    > Hello,
    >
    > I would like to create python processes instead of thread.
    > Can anyone give me an example or site which shows a tutorial about how
    > to create processes ?[/color]

    See the os.fork documentation.

    <mike
    --
    Mike Meyer <mwm@mired.or g> http://www.mired.org/home/mwm/
    Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

    Comment

    • ajikoe@gmail.com

      #3
      Re: create python process

      I use windows and os.fork is not working in windows.
      Can we create process inside python I mean I have function and I want
      to run it as a process not a thread ?

      Should I run code from os. in order to run a processes?

      Sincerely Yours,
      pujo

      Comment

      • Trent Mick

        #4
        Re: create python process

        [ajikoe@gmail.co m wrote][color=blue]
        > I use windows and os.fork is not working in windows.
        > Can we create process inside python I mean I have function and I want
        > to run it as a process not a thread ?
        >
        > Should I run code from os. in order to run a processes?[/color]

        Check out any or all of:

        subprocess (new module in Python 2.4)
        os.system
        os.popen, os.popen2, os.popen3, os.popen4

        Note that you can't just run a Python *function* in a separate process
        directly. You'll have to have some way to call:
        python.exe your_script.py
        such that your function gets called.

        Cheers,
        Trent

        --
        Trent Mick
        TrentM@ActiveSt ate.com

        Comment

        Working...