Re: how to do draw pattern with python?

2012-09-21 Thread Ismael Farfán
2012/9/21 Peter Otten <__pete...@web.de>: > echo.hp...@gmail.com wrote: > > print "\x1b[2J\x1b[0;0H" # optional Nice code : ) Could you dissect that weird string for us? It isn't returning the cursor to (0,0), it's just like executing clear(1), and looks like those line coloring scape sequen

Re: How to get the list of all my open file(descriptor)s and locks?

2012-09-19 Thread Ismael Farfán
2012/9/19 Christian Heimes : >> So the question: >> * If I execve a python script (from C), how can I retrieve the list of >> files, and optionally the list of locks, from within the execve(d) >> python process so that I can use them? > > Have a look at psutil: > > http://code.google.com/p/psutil/#

Re: How to get the list of all my open file(descriptor)s and locks?

2012-09-19 Thread Ismael Farfán
2012/9/19 Ian Kelly : > On Wed, Sep 19, 2012 at 2:36 PM, Ismael Farfán wrote: >> It seems like I can use os.fstat to find out if a fd exists and also >> get it's type and mode (I'm getting some pipes too : ) > > Sure, because files and pipes both use the file des

Re: How to get the list of all my open file(descriptor)s and locks?

2012-09-19 Thread Ismael Farfán
2012/9/19 Ismael Farfán : > Hello list > > From man 2 EXECVE > "By default, file descriptors remain open across an execve()" > > And from man 2 FCNTL > "Record locks are... preserved across an execve(2)." > > So the question: > * If I execve a pyth

Re: Passing arguments to & executing, a python script on a remote machine from a python script on local machine (using ssh ?)

2012-09-19 Thread Ismael Farfán
2012/9/19 ashish : > Hi c.l.p folks > > Here is my situation > > 1. I have two machines. Lets call them 'local' & 'remote'. > Both run ubuntu & both have python installed > > 2. I have a python script, local.py, running on 'local' which needs to pass > arguments ( 3/4 string arguments, containing

How to get the list of all my open file(descriptor)s and locks?

2012-09-19 Thread Ismael Farfán
Hello list >From man 2 EXECVE "By default, file descriptors remain open across an execve()" And from man 2 FCNTL "Record locks are... preserved across an execve(2)." So the question: * If I execve a python script (from C), how can I retrieve the list of files, and optionally the list of locks, f