I am trying to use the tools module pyboard.py with idle3 and it does seem to work but with a couple of weird things going on. See interactive session below:
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 pyboard.py led.py" from the command line.
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('led.py') Traceback (most recent call last): File "<pyshell#6>", line 1, in <module> pyboard.execfile('led.py') File "/home/richard/pyboard.py", line 354, in execfile pyb = Pyboard(device, baudrate, user, password) File "/home/richard/pyboard.py", line 229, in __init__ raise PyboardError('failed to access ' + device) pyboard.PyboardError: failed to access /dev/ttyACM0 >>> pyboard.execfile('led.py') b'LED(1)\r\nLED(2)\r\nLED(3)\r\nLED(4)\r\n' >>>
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.
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.