Ask Your Question
1

Using Wing with circuitpython

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

Bill Waggoner gravatar image

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

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

1 Answer

Sort by » oldest newest most voted
0

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

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

2 followers

Stats

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

Seen: 71 times

Last updated: Mar 14