getting command line in python

MrSmile no at mail.de
Tue Nov 8 17:36:13 EST 2011


Thank you all, that was it that I was searching for you.


Tamer

Am 08.11.2011 23:32, schrieb Cameron Simpson:
> On 08Nov2011 23:19, MrSmile <no at mail.de> wrote:
> | I am looking for a way to get the command line in the script.
> | 
> | Let us say I am in the folder "/tmp" okay!
> | 
> | now from /tmp I execute in the console this:
> | python /home/tamer/MyApp/MyScript.py
> | 
> | in the app itself, I want to grep the path and the scriptname itself,
> | like: /home/tamer/MyApp is being somewhere available.
> 
> Have you looked in sys.argv[0]?




More information about the Python-list mailing list