Home | Trees | Indices | Help |
---|
|
Tools for cursor and color control in the terminal
Example usage (this does not work in the documentation):
>>> print green('this text is green') this text is green >>> print blink('this text blinks')+' this text does not blink' this text blinks this text does not blink
You can combine all the possibilities, as the functions are generated on the fly:
>>> print blink_green_bgred_bold('blinking green bold text on red background') blinking green bold text on red background
|
|||
CallInstruct Generate a callable function on-the-fly. |
|||
MemoryMonitor | |||
Wrapper Wrap the module so that the getattr function can be
redefined.
|
|
|||
|
|||
|
|||
|
|
|||
RED = "\[\033[0;35m\]"
|
|||
YELLOW = "\[\033[0;33m\]"
|
|||
instructs = {'black': "\033[30m", 'red': "\033[31m", 'green':
|
|
Save cursor at current position, clear current line, print the message and reset the cursor.
|
Return one line at a time from a file-like object. >>> #p1 = subprocess.Popen('ls',shell=True,stdout=subprocess.PIPE) >>> #for line in line_at_a_time(p1.stdout): ... # print 'next line:',line.strip() >>> #retcode = p1.wait() use return model_number Works around the iter behavior of pipe files in Python 2.x, e.g., instead of "for line in file" you can write "for line in line_at_a_time(file)" |
Kill a running subprocess after a certain amount of time. Command represents the command for the process you would give in a terminal e.g. 'ls -l' in a terminal becomes ["ls", "-l"] or 'firefox' becomes ["firefox"]'; time_out is expressed in seconds. If the process did not complete before time_out, the process is killed.
|
|
instructs
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Mar 30 10:45:19 2018 | http://epydoc.sourceforge.net |