Hi,
I would need to figure out the user's home directory on the unix port. So... I could try to find out what $HOME corresponds to. Can this be done in micropython?
Can I read enviromenz variables?
-
- Posts: 50
- Joined: Thu Jul 07, 2022 7:40 am
Re: Can I read enviromenz variables?
import os
os.getenv('HOME')
os.getenv('HOME')
-
- Posts: 59
- Joined: Mon Mar 29, 2021 1:36 am
- Location: Brisbane Australia
Re: Can I read enviromenz variables?
Think about how you would do this in ordinary Python and always try that first. I.e. exactly as posted above.
Re: Can I read enviromenz variables?
@TheSilverBullet: Thanks, this works! I could have seen it myself with help(os)