On Wed, Feb 22, 2012 at 07:29:42PM -0800, Michael Lewis wrote: > First, thanks to everyone who helped me out regarding my Recognizing real > numbers post. I gained a lot of knowledge over the past two days! > > I've noticed that after I execute some of my .py files, a Compiled Python > File is automatically saved to my directory. This doesn't happen for every > file that I execute though. Why is that?
When you execute a file directly from the shell, using something like this command: $ python my_python_script.py no .pyc file is created. But when you import a file from within Python, either by hand or within a script: >>> import my_module Python compiles it and saves the compiled version to my_module.pyc so that the next time you call import, it will be faster. -- Steven _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor