IntelliJ和PyCharm中的MicroPython设备插件
The Python code development plugin for MicroPython devices in
PyCharm and IntelliJ.
The plugin supports Python development for these devices:
It will support more MicroPython devices and more device-specific and MicroPython-specific modules eventually. We are
interested in your contributions to the project. Feel free to open issues and send pull requests!
See also the changelog for the plugin.
Context-aware code completion and documentation
Use Ctrl+Q (F1 on macOS) for quick documentation window, you can dock it permanently
Syntax checking and type checking
The plugin checks your code while you’re typing it
Flash Python files or project directories to devices
Right-click on a file or directory and select “Run ‘Flash
connected device. If you want to flash a sub-directory to the root directory of your device, please mark this
sub-directory as a sources root: right-click on it and select “Mark Directory as | Sources Root”. Its
icon will become blue, see the screenshot.
You can edit your run configurations for flashing files or directories in “Run | Edit Configurations…”
menu.
MicroPython REPL
Use “Tools | MicroPython | MicroPython REPL” menu to run a MicroPython shell on your device. Or open
MicroPython REPL tool window directly
Install the “MicroPython” plugin from your IDE settings.
Create a new project or open an existing folder with your MicroPython code.
This step differs for PyCharm and IntelliJ:
IntelliJ: Add the MicroPython facet to a Python module in your project structure and specify the path to your
MicroPython device
Open any Python file in project. You may see a yellow bar on top of the file, notifying you that you don’t
have some packages required for communicating with your device. In this case click “Install requirements” and wait
while the plugin downloads and installs the packages.
We write this plugin in Python and Kotlin. Kotlin a new JVM language by JetBrains, the
makers of PyCharm and IntelliJ. Google recommends Kotlin as the best language for developing Android apps. If you are a
Python developer, Kotlin may be an interesting language for you to learn.
The steps for setting up the development environment:
To just run the development version use ./gradlew clean runIde
from the command line
or just run runIde run configuration.
Contributions are welcome!
The plugin is licensed under the terms of the Apache 2 license.