Is there any difference between:
__file__
and
sys.argv[0]
Because both seem to be doing the same thing: they hold
__file__ is the name of the current file, which may be different from the main script if you are inside a module or if you start a script using execfile() rather than by invoking python scriptname.py. __file__ is generally your safer bet.
execfile()
python scriptname.py