How to run a code in lopy stored on SD card?
-
Dear all,
I believe this is trivial question but I would be more than happy if you can help me to run a .py file stored on SD card connected to expansion board with lopy. I tried to find an answer in previous posts but got a bit confused..Thank you in advance!
Monika
-
@robert-hh great thank you it worked perfectly!
-
@monersss You have to mount the SD card first, e.g. with:
from os import mount, chdir from machine import SD sd = SD() mount(sd, '/sd')
Then you can chdir into /sd:
chdir("/sd")
and import the module, or directly import
import /sd/mymodule