Search code examples
pythonpyc

Is it safe to remove all python *.pyc files to force usage of new code?


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?


Solution

  • Yes, it's safe. Use pyclean command

    Usage: pyclean [-p PACKAGE] [DIR_OR_FILE]

    pyclean .