在Atom中启动文件时,该文件类型已在OS中关联(Launching a file from within Atom, when that file type is already associate

编程入门 行业动态 更新时间:2024-10-23 04:40:43
在Atom中启动文件时,该文件类型已在OS中关联(Launching a file from within Atom, when that file type is already associated in the OS)

我通常在Windows 7下用Python编写代码。只需双击任何文件管理器中的.py文件,即可在命令提示符下启动该文件,因为.py文件与c:\ Python27 \ python.exe相关联

所以我的问题是:我可以在Windows的命令提示符中以某种方式启动我正在Atom中工作的当前文件吗? 没有alt-tabing到文件管理器并单击我的意思是文件。 我尝试了很多包,大多数建议是脚本 。 但是我尝试过的所有软件包都在Atom的控制台上执行该文件,该控制台目前不支持stdin (无法通过raw_input()等命令输入数据)。 而这正是我目前最需要的。

有一个简单的解决方法吗? 我已经使用了几个小时,似乎无法在任何地方找到解决方案。

I generally code in Python, under Windows 7. Just double clicking a .py file in any file manager launches that file in the command prompt, due to the .py file association with c:\Python27\python.exe

So my question is: Can I somehow launch the current file that I'm working on in Atom in the Windows's command prompt? Without alt-tabing to the file manager and clicking the file I mean. I tried quite a lot of packages, most recommended being script. But all packages that I've tried execute the file in the Atom's console, which currently does not support stdin(can't input data through commands like raw_input()). And that is really what I require the most at the moment.

Is there an easy workaround? I've been at it for a few hours and can't seem to be able to find a solution, literally anywhere.

最满意答案

嗯......最终自己找到了答案。 如果有人在Windows下需要此功能,只需安装run-in-terminal 。 在插件的设置中,转到Terminal with arguments行框,然后输入start /D {working_directory} D:\Python27\python.exe {file_path} 。 只需按F5即可从主编辑器窗口运行代码。 完善!!!!

PS。 可能想要将D:改为C:取决于你的python文件的位置。 祝你好运!! <3原子

Well...eventually found an answer myself. If anyone needs this feature under windows, just install run-in-terminal. In the plug-in's settings go to line Terminal with arguments box and enter start /D {working_directory} D:\Python27\python.exe {file_path}. And simply press F5 to run the code from the main editor's window. PERFECT!!!!

PS. Might want to change D: to C: depending where your python file is. Good Luck!! <3 Atom

更多推荐

本文发布于:2023-08-05 08:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1431156.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:已在   该文件   类型   文件   Atom

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!