Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Script Compiling

John Byrne
2011-05-12
2013-01-25
  • John Byrne
    John Byrne
    2011-05-12

    I noticed that scripts are not compiled - there is no .pyc files created, but if I make a module script file it is compiled.
    Not having the scripts compiled makes a noticable difference in performance.
    I have created scripts for Notepad++ and Programmer's Notepad and have notice a big difference in the performance of the Python scripts - PN does create the .pyc files for each .py file.

     
  • This is actually the python default. Scripts that are run directly are not compiled - you can see the same effect if you use the Python command prompt - "python.exe script.py" - script.py is not compiled, but any imports it makes are.  If you do an "import " at some point, then it should create the .pyc file, which I think will then be used.

    Sorry for the massive delay in reply - must have missed this somehow.