El 28/02/2010, a las 1:03, Karen Tracey wrote:

If you are routinely needing to delete .pyc files after making code changes in the corresponding .py files, something is broken. The post I responded to stated: "Python generates a compiled version of the file, and if you don't delete it, it never get's updated." That is not commonly true. Python compares the modification date/ time of the .pyc file to same info for the .py file and if the .pyc file is out of date the existing .pyc file is ignored and a new one is regenerated from the current source. If this mechanism is not working on some system, it would be a good idea to track down why, because having to remember to delete .pyc files when changing code is bound to lead to headaches.

The only times I have to manually delete .pyc files are when I have deleting the corresponding .py files, or done a major restructuring and moved things around. I've never had to delete .pyc files for simple code changes. Running under a webserver or not makes no difference in this. Where running under a web server may make a difference is in the need to restart the server to get it to see changes. You generally don't need to do that for runserver, but usually do for production setups. You do not, however, need to delete .pyc files -- you just need to restart the server.

Karen


Yes Karen, that's what I thought from the beginning, something is broken in my Python installation, I'll explain it better. I'm currently using django dev server and it doesn't update the .pyc files, let's say I just change a line in the models, I have to delete the models.pyc file because python doesn't update i, if it helps, timestamps difer just seconds (I make quick changes).

This happens to me even on other programs where every change I make, I have to delete manually the .pyc file. As someone said before is like head-banging. How can I track down this problem? I'm not a programmer, this is just a hobby.

I'll test this on other python installation I have on my mac, just in case. Thanks everybody, and forgive my bad english ;)

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to