Created
November 17, 2020 23:39
-
-
Save pauleveritt/004db22d6af48e1be7662b742a65e54f to your computer and use it in GitHub Desktop.
How to re-parent an absolute path to be under a different root?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
def main(): | |
icon = Path('/favicon.png') | |
static = Path('/static') | |
result = static / icon | |
print(str(result)) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment