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
-
@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 -
@robert-hh great thank you it worked perfectly!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login