[Assorted-commits] SF.net SVN: assorted:[1385] sandbox/trunk/src/nix
Brought to you by:
yangzhang
From: <yan...@us...> - 2009-05-07 06:10:34
|
Revision: 1385 http://assorted.svn.sourceforge.net/assorted/?rev=1385&view=rev Author: yangzhang Date: 2009-05-07 06:10:33 +0000 (Thu, 07 May 2009) Log Message: ----------- added pty demo Added Paths: ----------- sandbox/trunk/src/nix/pty/ sandbox/trunk/src/nix/pty/master.py Added: sandbox/trunk/src/nix/pty/master.py =================================================================== --- sandbox/trunk/src/nix/pty/master.py (rev 0) +++ sandbox/trunk/src/nix/pty/master.py 2009-05-07 06:10:33 UTC (rev 1385) @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +# Demo that a forked process can read the same stdin + +import os, pty, time + +pid, fd = pty.fork() +if pid == 0: # Child + print 'Child with fd =', fd +else: + print 'Master with fd =', fd + print 'Read:', os.read(fd, 4096) Property changes on: sandbox/trunk/src/nix/pty/master.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |