python and vc numbers

Daniel Dalton d.dalton at iinet.net.au
Mon Nov 30 09:20:59 CET 2009


On Mon, Nov 30, 2009 at 02:21:54PM +1300, Gregory Ewing wrote:
> >I use to figure out what tty my program was invoked from?
> 
> Here's one way:
> 
> % python
> Python 2.5 (r25:51908, Apr  8 2007, 22:22:18)
> [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import os
> >>> os.popen("tty").read()

That did the trick, thanks, after I append 
[-2] 
It works great.

Thanks

Dan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20091130/223fe73c/attachment.pgp>


More information about the Python-list mailing list