从 Atom 运行 Python

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25585500/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-18 20:24:57  来源:igfitidea点击:

Running Python from Atom

pythonatom-editor

提问by pyCthon

In Sublime, we have an easy and convent way to run Python or almost any language for that matter using ?+ b(or ctrl+ b)

在 Sublime 中,我们有一种简单而传统的方式来运行 Python 或使用?+ b(或ctrl+ b)的几乎任何语言

Where the code will run in a small window below the source code and can easily be closed with the escape key when no longer needed.

代码将在源代码下方的小窗口中运行,并且可以在不再需要时使用转义键轻松关闭。

Is there a way to replicate this functionally with Github's atom editor?

有没有办法用 Github 的 atom 编辑器在功能上复制这个?

采纳答案by nwinkler

The scriptpackage does exactly what you're looking for: https://atom.io/packages/script

脚本包做你正在寻找什么:https://atom.io/packages/script

The package's documentation also contains the key mappings, which you can easily customize.

该包的文档还包含键映射,您可以轻松自定义这些映射。

回答by karthik G

Download and Install package here: https://atom.io/packages/script

在此处下载并安装软件包:https: //atom.io/packages/script

To execute the python command in atom use the below shortcuts:

要在 atom 中执行 python 命令,请使用以下快捷方式:

For Windows/Linux, it's SHIFT + Ctrl + B OR Ctrl + SHIFT + B

对于 Windows/Linux,它是 SHIFT + Ctrl + B 或 Ctrl + SHIFT + B

If you're on Mac, press ? + I

如果您使用的是 Mac,请按 ? +我

回答by Anirudh Maheswaram

To run the python file on mac.

在mac上运行python文件。

  1. Open the preferences in atom ide. To open the preferences press 'command + . ' ( ? + , )
  2. Click on the install in the preferences to install packages.

  3. Search for package "script" and click on install

  4. Now open the python file(with .py extension ) you want to run and press 'control + r ' (^ + r)

  1. 在 atom ide 中打开首选项。要打开首选项,请按 'command + 。' ( ? + , )
  2. 单击首选项中的安装以安装软件包。

  3. 搜索包“脚本”并点击安装

  4. 现在打开要运行的python文件(扩展名为.py),然后按'control + r'(^ + r)