Is it possible (not necessarly using python introspection) to print the source code of a script?
I want to execute a short python script that also print its source (s
As long as you're not doing anything crazy with packages, put this at the top of your script
with open(__file__) as f: print f.read()
Which will read in the current file and print it out.
For python 3 make sure to use instead print(f.read())
print(f.read())