Aptana Studio:将 .py 视为 html
我正在使用 Aptana Studio 3 在 python+django 中开发应用程序。但由于某种原因,Aptana Studio 将我的 .py 文件之一视为 html。
因此,对于该文件,我没有语法突出显示,而且当我尝试使用 Ctrl + '/' 注释代码时,它会用 html 注释标签 来包装代码python 注释标签,它还在末尾抛出一条警告消息:“应该插入缺少的‘标题’元素”。所有这些都表明 Aptana 需要一个 html 文件,尽管扩展名为 .py。
重要提示:我使用
,我所有其他 .py 文件都是在我创建项目时自动生成的,并且它们按预期工作。不过该文件编译得很好。
任何线索,发生了什么事?
I am using Aptana Studio 3 to develop an application in python+django. But for some reason Aptana Studio treats one of my .py file as html.
So, for that file I have no syntax highlighting, moreover when I try to comment code using Ctrl + '/', it wraps the code with html comment tags <!-- -->
instead of python comment tags and it also throws a warning message at the end saying: "should insert missing 'title' element". All of this suggesting that Aptana is expecting a html file despite .py extension.
Important: I manually created this file using <Package Name>(right click) > New > File
, all my other .py files are auto generated when I created the project and they are working as expected. The file compiles well however.
Any clue, what's happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了,使用
(右键单击)> 创建一个新的 .py 文件新的> PyDev 模块
。基本上创建New PyDev Module
并不重要。早些时候,我使用
New File
而不是New PyDev Module
,这导致 Aptana 将其视为常规文件(可能是 html),尽管其扩展名为 .py。I figured it out, create a new .py file using
<Package Name>(right click) > New > PyDev Module
. Basically createNew PyDev Module
doesn't matter how.Earlier I used
New File
instead ofNew PyDev Module
, which led to Aptana treating it as regular file (html probably) despite its .py extension.