I have a server running a Python app. I'm updating the app's code manually via sftp. Is it safe to remove the *.pyc files that are automatically created in my app's dir?
- 31. Yes. You don't have to reboot, if the .pyc is missing it will be automatically generated. Note that .pyc are automatically regenerated if its .py is newer. 2. How can I manually generate a .pyc file from a .py fileVincent Savard– Vincent Savard2016-06-27 15:04:55 +00:00Commented Jun 27, 2016 at 15:04
- 2compileall : stackoverflow.com/a/22779209/2142994Ani Menon– Ani Menon2016-06-27 15:06:10 +00:00Commented Jun 27, 2016 at 15:06
- Possibly related to stackoverflow.com/questions/5629135/…André Laszlo– André Laszlo2016-06-27 15:06:13 +00:00Commented Jun 27, 2016 at 15:06
- In my personal opinion is not needed, anyway you can use this to recompile all the python files on filesystem find / -iname '*.py' | xargs python -m py_compileuser2543740– user25437402016-06-27 15:07:02 +00:00Commented Jun 27, 2016 at 15:07
Add a comment |