Source From Here
QuestionI have a string representing a path. Because this application is used on Windows, OSX and Linux, we've defined environment variables to properly map volumes from the different file systems. The result is:
- "$C/test/testing"
HowTo
Use os.path.expandvars to expand the environment variables in the string, for example:
沒有留言:
張貼留言