Re: How to get progress in python script.

Discussion in 'Python' started by Jean-Michel Pichavant, Sep 28, 2012.

  1. ----- Original Message -----
    > Hi all,
    >
    > Please, I need you suggest me a way to get statistics about a
    > progress
    > of my python script. My python script could take a lot of time
    > processing a file, so I need a way that an external program check the
    > progress of the script. My first idea was that the python script
    > write a
    > temp file showing the progress and the external program can check
    > that
    > file, but I think might happen file read/write locking issues.
    >
    > Thanks.
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >


    Hello,

    One easy way would be to use a RPC system. Pyro implements one of them.
    See http://packages.python.org/Pyro4/tutorials.html

    This could be achieved in very few lines.

    Your script create a thread in which it serves the remote requests.

    xmlrpclib is another popular RPC package.

    Another solution is to use a web server (sounds overkill but it isn't).

    A lot of python web frameworks allow you to create such server in very few lines. look at http://www.cherrypy.org/ for instance, use their 'hello word' example and replace the 'hello word' by the current script progress and you're done.

    JM
     
    Jean-Michel Pichavant, Sep 28, 2012
    #1
    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. Charlie Zhang
    Replies:
    3
    Views:
    1,294
    Paul Lutus
    Aug 16, 2004
  2. Leo Jay
    Replies:
    1
    Views:
    263
    Peter Hansen
    Jul 14, 2005
  3. Rajarshi
    Replies:
    1
    Views:
    300
    Larry Bates
    May 18, 2007
  4. Rolando Cañer Roblejo

    How to get progress in python script.

    Rolando Cañer Roblejo, Sep 28, 2012, in forum: Python
    Replies:
    2
    Views:
    279
    Colin J. Williams
    Sep 30, 2012
  5. Saikat Saha
    Replies:
    1
    Views:
    198
    Ray_Net
    Feb 11, 2014
Loading...

Share This Page