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
signature.asc
Description: Digital signature
-- http://mail.python.org/mailman/listinfo/python-list