Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install run

How to install run

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install run
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2 Available View build log
Windows (64-bit)
0.2 Available View build log
Mac OS X (10.5+)
0.2 Available View build log
Linux (32-bit)
0.2 Available View build log
Linux (64-bit)
0.2 Available View build log
 
License
MIT
Imports
Lastest release
version 0.2 on Jan 5th, 2011

This module provides convenient ways to guarantee a certain script state.

run.alone

Make sure only one instance of the program is running, this is done by acquiring an fcntl file lock on the current script:

>>> import run.alone
Caveats

There are a few things to keep in mind:

  1. import run.alone once, it will exit your program if it gets imported twice
  2. symlinked scripts will be resolved to the inode it has been linked to, this is a limitiation of using fcltn file locks

run.until

Run until a specified timespec, if the process runs longer, it will be killed:

>>> import run
>>> run.until('23m42s')
>>> ...

You can also choose to limit on the amount of CPU-time being consumed (default is wall clock time):

>>> run.until('42s', 'cpu')
>>> ...

Acknowledgements

This module is dirived from the Sys::RunAlone and Sys::RunUntil perl modules written by Elizabeth Mattijsen.

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.