© Copyright 2000-2015 Source Code Online. Free Source Code and Scripts Downloads.
|Code Listing by Giampaolo Rodol?|
A python class which "watches" a directory and calls a callback(filename, lines) function every time one of the files being watched gets written, in real time.
Practically speaking, this can be compared to "tail -f *.log" UNIX command, but instead of having lines printed in the terminal, we have a python function called instead.
Similarly to tail, it takes care of "watching" new files which...
A decorator to deprecate a function and provide a new one as replacement.
A decorator for profiling a function which prints profiling results to stdout.
This was originally proposed as a patch for inclusion into python stdlib:
Note that on certain Linux systems...
Two functions: one which waits for a certain PID to terminate (with optional timeout), another one which checks whether a process with a given PID is running.
This was extracted from psutil project which also provides a Windows...
Provides disk usage statistics (total, used and free disk space) about a given path.
This recipe was initially developed for psutil:
A context manager which properly handles SIGTERM (SystemExit) and SIGINT (KeyboardInterrupt) signals, registering a function which is guaranteed to be called after signals are received.
Also, it makes sure to execute previously registered...
The thing I miss mostly in asyncore is a system for calling a function after a certain amount of time without blocking. This is crucial for simple tasks such as disconnecting a peer after a certain time of inactivity or more advanced use cases...
Ok, this is really simple but I think it worths a recipe as it's one of those things I always use in shell scripts and for debugging in general.
A simple constant type which overrides the base integer type to provide a useful name on str().
All files and free downloads are copyright of their respective owners. We do not provide any hacked, cracked, illegal, pirated version of scripts, codes, components downloads. All files are downloaded from the publishers website, our file servers or download mirrors. Always Virus check files downloaded from the web specially zip, rar, exe, trial, full versions etc. Download links from rapidshare, depositfiles, megaupload etc not published.