Hi gldrplt, you stated:
“On Raspberry PI this code works”
I doubt that very much. Or at least, if it does work, it is not running
standard Python, and there is no setting to enable this behaviour. It
goes completely against the Python language standard for that to work in
the general case, and I can’t find anything in the RaspberryPi
documentation to suggest that it should work.
I suspect that you have accidentally done
from time import * earlier
in your code, or session, and that’s why it works. If not done by you,
possibly in your PYSTARTUP file.
You can try this to test it. Create a file containing exactly those two
lines above, called “mytest.py”, and then run this from the RaspberryPi
python3 -E -S mytest.py
I expect you will get the same error as you do on Windows.
If you need help getting the RaspberryPi shell, or command line, you can
Having Python automatically look inside modules when you call a function
might seem like a good time saver now, but when you gain more experience
and are writing more complex scripts, you will soon learn that this is
trouble waiting to bite.