Go to Settings/Editor/General, scroll to the bottom and adjust the On Save options. By default PyCharm (and all JetBrain IDEs) automatically saves files, so this will occur whenever you modify a file.
On Save