How to create a script that list itself ?

Patrick Allaire pallaire at gmail.com
Mon Jan 9 13:09:19 EST 2006


How to create a script that list itself ?

I would like to know, where is the script's code is stored once we
start it. I know I can achieve that, using files :

print file('myscript.py','rb').read()

But is there a way / a variable that contains the current file in
memory ?

Thanks.

Xaqc




More information about the Python-list mailing list