May-24-2023, 04:43 PM
result:
3.4.0; MicroPython v1.20.0 on 2023-04-26
3.4.0; MicroPython v1.20.0 on 2023-04-26
function on a different tab ?
|
May-24-2023, 04:43 PM
result:
3.4.0; MicroPython v1.20.0 on 2023-04-26
May-24-2023, 04:51 PM
i installed:
micropython-pathlib now i get: Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: can't import name Path
May-24-2023, 04:55 PM
I understand. I'm not used to MicroPython. We'll do without pathlib, use this code
import os import sys print('Cwd is {}'.format(os.getcwd())) print('Current program is {}'.format(__file__)) print('Sys.path is {}'.format(sys.path)) import examplemodI guess you don't have fstrings either.
May-24-2023, 05:00 PM
it gives:
Cwd is / Traceback (most recent call last): File "<stdin>", line 4, in <module> NameError: name '__file__' isn't defined
May-24-2023, 05:07 PM
May-24-2023, 05:13 PM
i'am pressing the green circle with te with triangel in it:
run current script (F5)
May-24-2023, 05:24 PM
(This post was last modified: May-24-2023, 05:25 PM by Gribouillis.)
Again I find strange that
__file__ is not defined but try to put this at the top of maintest.pyif '__file__' not in vars(): __file__ = sys.modules[__name__].__file__
May-24-2023, 05:30 PM
result:
Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'vars' isn't defined ![]()
May-24-2023, 05:41 PM
(This post was last modified: May-24-2023, 05:41 PM by Gribouillis.)
if '__file__' not in globals(): __file__ = sys.modules[__name__].__file__I think MicroPython contains only a part of the standard library. There are good reasons for that I suppose.
May-24-2023, 05:41 PM
Traceback (most recent call last):
File "<stdin>", line 2, in <module> NameError: name 'sys' isn't defined |
|