use of tools module with idle3

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Posts: 13
Joined: Sun Dec 18, 2016 8:09 pm

use of tools module with idle3

Postby katesfb » Thu Jun 08, 2017 3:31 am

I am trying to use the tools module with idle3 and it does seem to work but with a couple of weird things going on. See interactive session below:

Code: Select all

Python 3.4.3 (default, Nov 17 2016, 01:11:57) 
[GCC 4.8.4] on linux
Type "copyright", "credits" or "license()" for more information.
>>> import sys
>>> sys.path.append('/home/richard/Dev/Micropython/micropython-master/tools')
>>> sys.path.append('/home/richard/Dev/Micropython/micropython-master/tests/pyb')
>>> import pyboard
>>> pyboard.execfile('')
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
  File "/home/richard/", line 354, in execfile
    pyb = Pyboard(device, baudrate, user, password)
  File "/home/richard/", line 229, in __init__
    raise PyboardError('failed to access ' + device)
pyboard.PyboardError: failed to access /dev/ttyACM0
>>> pyboard.execfile('')
The first weird thing is that the text output that occurs only occurs after the program has completed running (testing the leds) whereas it should appear first and does so if i run the command "python" from the command line.
The 2nd weird thing is that the error related to failing to access /dev/ttyACM0 only occurs if i havent previously run the program from the command line.

Any ideas.

My reason for doing this is to write a small very simple tkinter GUI that will run a pyboard script from idle.

Any help is much appreciated.


Posts: 13
Joined: Sun Dec 18, 2016 8:09 pm

Re: use of tools module with idle3

Postby katesfb » Sun Jun 18, 2017 10:33 pm


User avatar
Posts: 1856
Joined: Fri Jul 18, 2014 8:01 am

Re: use of tools module with idle3

Postby pythoncoder » Mon Jun 19, 2017 6:43 am

pyboard.execfile buffers text from the running script and only outputs it on completion.

Regarding the serial port issue I can't replicate this under Linux. I have no means of testing under Windows but my guess is that it's a Windows issue. Perhaps a user will elaborate.
Peter Hinch

Who is online

Users browsing this forum: XIVN1987 and 2 guests