This plugin provides actions to allow executing Python code using "cells" in PyCharm, much like Spyder.
A "code cell" is a block of lines, typically delimited by ##
, for example:
##
print 'foo'
if True:
print 'bar'
##
The plugin options allow you to specify your own regular expression to delimits code cells.
This plugin provides 3 actions under the Code menu, and you can assign keyboard shortcuts to each:
- Run Cell: run the current cell
- Run Cell and Move Next: run the current cell and advance cursor to next cell
- Run Line under the caret
When using Run Cell and Move Next
and there is no next cell, a delimiter (which can be specified in the options, but which is unrelated to the above described regular expression) will be inserted in the source code.
The cell can be sent to either :
- the internal IPython console
- an external IPython kernel running in a tmux
The second option allows you to have a working interactive matplotlib in an external IPython process.
Check the "Python Cell Mode" settings in the preferences to switch between the two modes.
This plugin is similar to https://github.com/julienr/vim-cellmode
Install from jetbrains plugin repository
Alternatively, you can install directly from the jar :
- Download PythonCellMode.jar
- In PyCharm, go to "Preferences", search for "plugin". Click on "Install from disk" and choose the downloaded jar
- Restart PyCharm and use the new actions in the "Code" menu
- (optional) Configure keyboard shortcuts by searching for "Cell" in your keymap
For now, here are some instructions from memory that may be helpful: (copied from https://github.com/Khan/ka-pycharm-plugin )
- Install IntelliJ IDEA Community Edition.
- Open the repo as an IntelliJ project.
- Choose your PyCharm installation as the plugin development SDK.
- Make a run configuration from within IntelliJ and run it. If things work, it will launch a fresh PyCharm instance with the plugin installed, which you can use for testing.
After just loading the plugin in Intellij, you might have missing dependencies on com.jetbrains.python.console
.
As explaind on this page, what you need to do is to manually add 'python-ce' to the classpath of the selected SDK (Pycharm community edition).
To do so, right click on 'PythonCellMode' -> Open Module Settings and then your SDK should look like this:
https://bjorn.tipling.com/how-to-make-an-intellij-idea-plugin-in-30-minutes
https://confluence.jetbrains.com/display/IDEADEV/PluginDevelopment