Ask Your Question

Using Wing with circuitpython

asked 2020-03-14 08:27:26 -0600

Bill Waggoner's avatar

updated 2020-03-20 09:27:32 -0600

I have what I think is an interesting use case. I am playing with some micro computers that run Circuit Python. The device appears as a mounted volume on your desktop and when you save your code to there it runs automatically on the device.

The syntax is Python 3 basically but the standard libraries are slightly limited versions of standard python and also include specialized hardware specific libraries.

Editing the code is “normal” but there are two things I would like to do to integrate Wing into the circuit python environment more closely.

First, is integrating the libraries into Wing’s code completion system. Because these libraries are not part of the systems sys.path I don’t think it’s going to be able to scrape them for class definitions, etc. I haven’t tried but maybe there is a way to include them into the path? I suspect so. But haven’t looked yet.

But the more challenging case is access to the REPL on the device. When the device is connected a serial port is defined that is a direct connection to the console. When your program is running it provides normal console output (print statements, traces, other messages) and when requested it becomes the REPL. Normally on my Mac I use screen to connect to the serial port. It would be great if I could have Wing connect so it would be integrated into the Wing environment.

So, is anyone else using Wing in this sort of situation? If so, what are you doing to make it more integrated? Does this sound like an interesting use case or am I all by myself here ... ?

edit retag flag offensive close merge delete


I have just picked up some CircuitPython compatible boards from Adafruit. (RP2040, Neo Trinkey and others) and am looking at the same kind of things. I'm about to make a custom build step that copies the file into a renamed "" file on the boards drive (to keep a real source file properly named on my host computer.) I'll be interested in the solution to this and the handling of the different libraries in CircuitPython.

RufusVS's avatar RufusVS  ( 2021-04-30 16:28:08 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2020-03-16 11:12:36 -0600

A couple things to try --

  • Copy .py files from the Circuit Python's sys.path to a directory on your machine and add this directory to the Python Path in the Project Properties dialog box. Wing should pick up the modules from this directory.
  • Create an OS command in the OS Commands tool to connect to the serial port. I'm assuming that there's a command line program that connects to it as a shell.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-03-14 08:27:26 -0600

Seen: 342 times

Last updated: Mar 14 '20