Python Files Turn Into Plain Text When I Come Back

I believe the grammar does not save. Whenever I close a python file and then come back, it turns into a “Plain Text” file. Is there a fix for this?

Are the files saved with .py extensions?