[EMAIL PROTECTED] wrote: > Can I get whole commandline not only argument list. > > 1. When I command like this > $ a.py > filename > 2. sys.argv is returns only argument list > ['a.py'] > > Is there a way to find out 'redirection' information.
It's not possible to find the exact command line redirections. However, you can tell whether a standard I/O stream has been redirected or not (kind of) using isattr attribute. For instance, sys.stdin.isatty() returns 1 when it's not being redirected. It's not exact, though. It's possible to redirect to a device that is a tty, and sometimes standard I/O streams will not be ttys even without redirection, such as when run by a script with redirection. (It shouldn't be a problem, since the main use case is to check whether the program should run in interactive mode or not.) Carl Banks -- http://mail.python.org/mailman/listinfo/python-list