是否有类似RStudio for Python的东西?[关闭]

问题:是否有类似RStudio for Python的东西?[关闭]

在RStudio中,可以在代码编辑窗口中运行部分代码,结果将显示在控制台中。

您还可以做一些很酷的事情,例如选择是运行光标之前的所有内容,还是光标之后的所有内容,还是只是选择的部分,等等。所有这些东西都有热键。

这就像Python交互式外壳之上的一个步骤-您可以在其中使用readline返回上一行,但是它没有任何关于功能是什么,代码段等的“概念”。

是否有类似Python的工具?或者,您是否有某种类似的解决方法,例如在vim中使用?

In RStudio, you can run parts of code in the code editing window, and the results appear in the console.

You can also do cool stuff like selecting whether you want everything up to the cursor to run, or everything after the cursor, or just the part that you selected, and so on. And there are hot keys for all that stuff.

It’s like a step above the interactive shell in Python — there you can use readline to go back to previous individual lines, but it doesn’t have any “concept” of what a function is, a section of code, etc.

Is there a tool like that for Python? Or, do you have some sort of similar workaround that you use, say, in vim?


回答 0

IPython Notebooks很棒。我最近发现了另一个基于浏览器的更新工具:Rodeo。我的印象是,它似乎可以更好地支持类似RStudio的工作流程。

IPython Notebooks are awesome. Here’s another, newer browser-based tool I’ve recently discovered: Rodeo. My impression is that it seems to better support an RStudio-like workflow.


回答 1

Jupyter Notebook(以前称为IPython Notebook)是一个非常酷的项目,用于使用Python(和其他语言,包括R)进行交互式数据操作。基本上,它允许您在一个界面中交互地编码和记录正在执行的操作,然后将其另存为:

  • 笔记本(.ipynb
  • 脚本(仅包含源代码的.py文件)
  • 静态html(因此也是pdf)

您甚至可以使用nbviewer服务与他人在线共享您的笔记本,该服务使人们可以出版整本书。此外,GitHub 呈现您的.ipynb文件。您可以将Jupyter笔记本作为可复制的研究文章发表在Authorea上。要由多个用户进行协作编辑,请查看基于Jupyter构建的Google Colab。

Jupyter Notebook的默认版本在本地启动Web应用程序(或将其部署到服务器),然后从浏览器中使用它。正如Ryan在回答中提到的那样,Rodeo是一个与基于Jupyter内核构建的RStudio更相似的界面。

JupyterLab是UI的较新版本,它为您编辑笔记本,控制交互式小部件甚至在终端仿真器中运行命令提供了更大的灵活性。

还有一个用于IPythonQt控制台,这是一个带有嵌入式绘图的类似项目,它是一个桌面应用程序。

Jupyter是一个普通的Python软件包,可以使用安装pip install jupyter。但是,要使所有科学图书馆都在您的计算机上运行,​​尝试使用官方的Jupyter Docker容器可能会更容易。例如,假设您的笔记本在〜/ code / jupyter中,则可以按以下方式运行容器:

docker run -it --rm -p 8888:8888 -v ~/code/jupyter:/home/jovyan/work jupyter/datascience-notebook

Jupyter Notebook (previously known as IPython notebook) is a really cool project for interactive data manipulation in Python (and other languages, including R). It basically allows you to interactively code and document what you’re doing in one interface and later on save it as a:

  • notebook (.ipynb)
  • script (a .py file including only the source code)
  • static html (and therefore pdf as well)

You can even share your notebooks online with others using the nbviewer service, where people publish whole books. Furthermore, GitHub renders your .ipynb files. You can publish your Jupyter Notebooks as reproducible research articles on Authorea. For collaborative editing by multiple users, check out Google Colab built on top of Jupyter.

The default Jupyter Notebook version starts a web application locally (or you deploy it to a server) and you use it from your browser. As Ryan also mentioned in his answer, Rodeo is an interface more similar to RStudio built on top of the Jupyter kernel.

JupyterLab is a newer take on the UI allowing for more flexibility in how you edit your notebooks, control interactive widgets and even run commands in terminal emulators.

There’s also a Qt console for IPython, a similar project with inline plots, which is a desktop application.

Jupyter is a normal Python package and can be installed using pip install jupyter. To get all the scientific libraries running on your computer, however, it might be easier to try the official Jupyter Docker containers. For example, assuming your notebooks are in ~/code/jupyter, you can run the container as:

docker run -it --rm -p 8888:8888 -v ~/code/jupyter:/home/jovyan/work jupyter/datascience-notebook

回答 2

spyder或安装python(x,y)。这太棒了。

如果您不熟悉Python,则可以安装免费的Anaconda发行版(http://continuum.io/downloads.html),它将为您安装Spyder以及Python 2.7和IPython。Spyder与RStudio非常相似。

spyder or install python(x,y). it is great.

If you are new to Python, you can install the free Anaconda distribution (http://continuum.io/downloads.html), which will install Spyder for you, as well as Python 2.7 and IPython. Spyder is very similar to RStudio.


回答 3

如果您正在寻找RStudio for Python之类的东西,请查看Yhat的Rodeo

牛仔竞技有:

  • 文本编辑器(在后台使用Atom)
  • Vim / Emacs模式
  • IPython控制台
  • 自动完成
  • 文档字符串
  • 能够查看图表,数据框,变量

Check out Rodeo from Yhat if you’re looking for something like RStudio for Python.

Rodeo has:

  • text editor (uses Atom under the hood)
  • Vim / Emacs mode
  • an IPython console
  • autocomplete
  • docstrings
  • ability to see plots, dataframes, variables

回答 4

您可能需要研究JupyterLab(下一代Jupyter Notbooks):https : //github.com/jupyter/jupyterlab

JupyterLab旨在在Web上创建更类似于桌面的体验。

更新:截至2018年3月,JupyterLab处于beta版。“该Beta版本适合一般使用。对于JupyterLab扩展开发人员而言,扩展API将会继续发展,直到1.0版本。最终,JupyterLab将在JupyterLab达到1.0后替换经典的Jupyter Notebook。

要将Jupyter Lab作为桌面应用程序运行,请参阅 christopherroach.com/articles/jupyterlab-desktop-app(感谢PatrickT)。

快速预览:

您可以在监视系统的终端上方的图形控制台旁边放置一个笔记本,同时将文件管理器保持在左侧:

有关更多详细信息,请参见:https : //blog.jupyter.org/2016/07/14/jupyter-lab-alpha/以及此处:http : //www.techatbloomberg.com/blog/inside-the-collaboration-that-内置了开源jupyterlab-project /

You might want to look into JupyterLab (the next generation of Jupyter Notbooks): https://github.com/jupyter/jupyterlab.

JupyterLab aims to create a more desktop-like experience on the Web.

Update: As of March 2018 JupyterLab is in beta. “The beta releases are suitable for general usage. For JupyterLab extension developers, the extension APIs will continue to evolve until the 1.0 release. Eventually, JupyterLab will replace the classic Jupyter Notebook after JupyterLab reaches 1.0.

To run Jupyter Lab as a Desktop Application, see christopherroach.com/articles/jupyterlab-desktop-app (Thanks to PatrickT).

Here’s a quick preview:

You can arrange a notebook next to a graphical console atop a terminal that is monitoring the system, while keeping the file manager on the left:

For more details see: https://blog.jupyter.org/2016/07/14/jupyter-lab-alpha/ and here: http://www.techatbloomberg.com/blog/inside-the-collaboration-that-built-the-open-source-jupyterlab-project/.


回答 5

Pycharm是一个非常不错的IDE。从目前为止我所看到的,它与Rstudio最相似。另一个不错的功能是,它允许您以类似于Rstudio的方式安装新的Python库(否则可能是一场噩梦)。现在有一个免费的“社区”版。

Pycharm is a really decent IDE. From what I have seen so far it is the most similar to Rstudio. Another nice piece is that it allows you to install new Python libraries in a fashion similar to Rstudio (which otherwise can be a nightmare). There is now a free ‘community’ edition.


回答 6

我认为值得一提的是RStudio v1.1.359 Preview已发布。它具有可用于Python的终端功能。

在此处下载

文档在这里

I think it is worth while to mention that RStudio v1.1.359 Preview is released. It has terminal feature that can be used for Python.

Download is available here

Documentation is available here


回答 7

间谍是您所需要的! https://code.google.com/p/spyderlib/
Spyder(以前称为Pydee)是功能强大的Python语言交互式开发环境,具有高级编辑,交互式测试,调试和自省功能

spyder is you need! https://code.google.com/p/spyderlib/
Spyder (previously known as Pydee) is a powerful interactive development environment for the Python language with advanced editing, interactive testing, debugging and introspection features


回答 8

对于更好的Python交互式外壳,请查看DreamPie。它不是真正的IDE(就像RStudio一样?)

For a nicer interactive shell for Python, have a look at DreamPie. It’s not really an IDE though (as RStudio seems to be?)


回答 9

Wing IDE,以及其他Python IDE(例如PyCharm和PyDev)也具有类似的功能。在Wing中,您可以在集成的Python Shell中选择并执行代码,或者如果要调试某些内容,则可以与Shell中暂停的调试程序进行交互(称为“调试探针”)。万一您正在使用matplotlib,它还提供了特殊支持,因此您可以交互使用绘图。

Wing IDE, and probably also other Python IDEs like PyCharm and PyDev have features like this. In Wing you can either select and execute code in the integrated Python Shell or if you’re debugging something you can interact with the paused debug program in a shell (called the Debug Probe). There is also special support for matplotlib, in case you’re using that, so that you can work with plots interactively.