I would really like to make "stand alone" python terminal

Code: Select all
from machine import I2C
i2c=I2C(1)
i2c.init(freq=1000000)
oled = SSD1306_I2C(128, 64, i2c)
console = FBConsole(oled)
os.dupterm(console)
Code: Select all
$ ~/webrepl/webrepl_cli.py FBConsole.py 192.168.4.1:
Password:
op:put, host:192.168.4.1, port:8266, passwd:abcd.
FBConsole.py -> /FBConsole.py
Remote WebREPL version: (1, 9, 4)
Sent 2294 of 2294 bytes
$
Code: Select all
>>> from FBConsole import FBConsole
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "FBConsole.py", line 3, in <module>
AttributeError: 'module' object has no attribute 'IOBase'
>>>
>>> import FBConsole
>>> console = FBConsole(oled)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
>>>
Code: Select all
MicroPython v1.9.4-564-gcb3c66e79 on 2018-09-21; ESP32 module with ESP32
Type "help()" for more information.
>>> import uio
>>> uio.
__class__ __name__ BufferedWriter BytesIO
FileIO IOBase StringIO TextIOWrapper
open
Code: Select all
$ webrepl_client.py 192.168.4.1
Password:
WebREPL connected
>>>
>>>
MicroPython v1.9.4 on 2018-05-11; ESP32 module with ESP32
Type "help()" for more information.
>>> uos.listdir()
['boot.py', 'webrepl_cfg.py', 'ssd1306.py', 'pye.py', 'FBConsole.py']
>>>
Code: Select all
>>> import uio
>>> help(uio)
object <module 'uio'> is of type module
__name__ -- uio
open -- <function>
FileIO -- <class 'FileIO'>
TextIOWrapper -- <class 'TextIOWrapper'>
StringIO -- <class 'StringIO'>
BytesIO -- <class 'BytesIO'>
BufferedWriter -- <class 'BufferedWriter'>
>>>
Code: Select all
MicroPython v1.9.4-623-g34af10d2e on 2018-10-03; ESP32 module with ESP32
Code: Select all
>>> from FBConsole import FBConsole
>>> console = FBConsole(oled)
>>> os.dupterm(console)
<_webrepl>
>>>
Code: Select all
>>> os.listdir()
['boot.py', 'webrepl_cfg.py', 'FBConsole.py', 'pdupterm: Exception in write() method, deactivating: Traceback (most recent call last):
File "FBConsole.py", line 62, in write
File "FBConsole.py", line 50, in _putc
File "FBConsole.py", line 77, in _newline
AttributeError: 'SSD1306_I2C' object has no attribute 'fill_rect'
ye.py', 'ssd1306.py']
>>>
Is there a problem with the official version? It definitely supports fill_rect().
Thanks for asking, I looked at it but found no "fill_rect" in that file.pythoncoder wrote: ↑Thu Oct 04, 2018 5:01 amIs there a problem with the official version? It definitely supports fill_rect().