I wanted to see the python compiled files (.pyc) when i execute python .py files.
help me how would i get .pyc files generated.
The .pyc file is generated automatically when you execute python a .py file from the command line (python mymodule.py) and it will be in the same directory as the .py file that you executed. IDLE has a curious way of not doing this which I don't understand. Most other IDEs will generate the .pyc files also.
As long as this thread is still open, the easiest way to compile a python file into .pyc is the following:
You have a file, "C:/documents and settings/user/not_compiled.py ". You want to compile that file. Create another python file in the same directory. In that file, type "import not_compiled". That will run the program as a module, but it will also compile the program into a .pyc file in the same directory as the original file.
As long as this thread is still open, the easiest way to compile a python file into .pyc is the following:
You have a file, "C:/documents and settings/user/not_compiled.py ". You want to compile that file. Create another python file in the same directory. In that file, type "import not_compiled". That will run the program as a module, but it will also compile the program into a .pyc file in the same directory as the original file.
Comment