Aptana Studio:将 .py 视为 html

发布于 2025-01-04 01:50:14 字数 427 浏览 5 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苍暮颜 2025-01-11 01:50:14

我想通了,使用 (右键单击)> 创建一个新的 .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 create New PyDev Module doesn't matter how.

Earlier I used New File instead of New PyDev Module, which led to Aptana treating it as regular file (html probably) despite its .py extension.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文