How to change a file to python file

Answered

in Pycharm Professional, I created a file called "lab06" forgetting the .py extension. Pycharm made this a simple text file. I deleted this file and tried to create a new file called "lab06.py" but this is still treated as a simple text file and not recognized as a python file.

Anyone know why this is the case?

2
9 comments

Hello,

Please try to remove "lab06" from Text file type association in "Settings | Editor | File Types".

 

5

Yes, that worked... Thank you!

1

Had the same issue. Now it is solved. Thanks.

0

i had to remove my File under "Settings | Editor | File Types | Auto-detect file type by content

3

I did it but it doesn't work please help me.

0

i have removed .ask3 from file name patterns but nothing happened.

@Yaroslav Bedrov 

0

Hello Michnikf3,

 

Please try starting the IDE with default settings as described here https://www.jetbrains.com/help/pycharm/configuring-project-and-ide-settings.html#restore-defaults 

 

Let me know how it works. 

 

 

0

I unistalled the program and after I downloaded again. Everything works fine !!!
thanks for your time ~

0

I had a similar situation but the file was not under "Text" in Settings -> Editor -> File Types, it was under "Auto-detect based on file content". Once I deleted it from there, things worked fine.

2

Please sign in to leave a comment.