Cra*_*der 116
请检查File| Settings,确保文本文件中未列出文件名或扩展名.
要解决此问题,请将其从文本文件中删除,并仔细检查该Preferences扩展名是否与Python文件相关联.
小智 67
我有一个类似的问题,其中某些.py文件在完成后显示为常规文本文件,因此呈现代码没有语法着色,选项卡完成功能等.通过使用此帖子作为调试问题的起点,我发现以下内容:
Recognized File Types(在我的示例中为文本文件)Registered Patterns我遇到命名/语法问题的文件的名称.我点击了每一个,然后依次点击-每个,从Registered Patterns列表中删除它们.ApplyWes*_*Wes 24
我意外地制作了一个文本文件myfilename,将其重命名为myfilename.py版本,但即使在扩展名更改后,它仍然保留了文本文件格式.
以下是我为For PyCharm 2017.2 for Windows修复它的方法.
File > Settings > Editor > File Types > TextRegistered Patterns,我myfilename.py在列表中找到了新的.-按钮将其从列表中删除OkChr*_*ris 24
我有一个类似的问题,已经提交的答案都没有帮助解决它。
我最终发现我受影响的文件名列Auto-detect file type by content在首选项->编辑器->文件类型的
部分中。从那里删除文件名并应用更改立即解决了我的问题。
小智 9
终于搞定了!
我有同样的问题.我尝试删除〜/ Library文件夹中的pycharm缓存无济于事.保持在日志中说"有些骷髅无法生成......"
那么,这是有效的.
最常见的问题是您的txt文件类型中包含.py
另一个不时发生的事情是,您已将实际文件名与txt文件类型相关联
解决方案保持不变
导航到文件->设置->文件类型->文本文件,然后查找.py或被格式化为文本的“文件名”
I faced a similar issue on PyCharm 2021.1. As mentioned in the other solutions, the .py file that was being rendered as a text file was not present in the following menu:
File | Settings | Editor | File Types | Recognized File Types | Text | File name patterns
Run Code Online (Sandbox Code Playgroud)
The following worked for me instead:
Select the file in the editor | File | File properties | Associate with File Type...
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
36719 次 |
| 最近记录: |