On Sunday, November 17, 2013 8:24:56 PM UTC-5, 黄祥 wrote:
>
> On Sunday, November 17, 2013 9:37:31 PM UTC+7, Anthony wrote:
>>
>> Python will create a .pyc file for any module (same for modules in 
>> web2py). However, unlike in Django, web2py model and controller files are 
>> not Python modules.
>>
>  
> so that's the reason, why only in modules folder, web2py automatic 
> generate *.pyc files..
>

It is not web2py that is creating the .pyc files (likewise, Django doesn't 
create any .pyc files). Rather, the Python interpreter automatically 
creates .pyc files for any module when it is imported. Files in the web2py 
/modules folder are imported modules, so just like any other imported 
Python module, the interpreter generates .pyc files for them. The reason 
.pyc files are not generated for controller and model files is because they 
are not modules and are never imported. Similarly, in Django, no .pyc files 
are generated for templates because the templates are not Python modules.

Keep in mind that once you have finalized your app code in web2py, you can 
bytecode compile the application, so you get .pyc files for all model, 
controller, and view files.

Anthony 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to