Re: Puzzling output when executing .pyc file directly

2005-12-14 Thread Peter Otten
Steven D'Aprano wrote: > bash-2.03$ python tester.pyc > Doing stuff with things now... > 6 > run_pyc_file: nested_scopes: 0 > > > Can anyone tell me what the run_pyc_file line is doing > in the output of the .pyc file? Is that normal > behaviour when calling a .pyc file? > > For my sins, I am u

Re: Puzzling output when executing .pyc file directly

2005-12-14 Thread Steve Holden
Steven D'Aprano wrote: > I created a simple test file called "tester.py": > > > def dostuff(obj): > print "Doing stuff with %s now..." % obj > return len(str(obj)) > x = "things" > if __name__ == "__main__": > print dostuff(x) > > > imported it into Python, then exited the curren

Puzzling output when executing .pyc file directly

2005-12-13 Thread Steven D'Aprano
I created a simple test file called "tester.py": def dostuff(obj): print "Doing stuff with %s now..." % obj return len(str(obj)) x = "things" if __name__ == "__main__": print dostuff(x) imported it into Python, then exited the current Python session. Then I compared the results