Last active
July 8, 2024 15:57
-
-
Save mh0w/04e00ce5a05226366d599d1d3b31ebd8 to your computer and use it in GitHub Desktop.
Add directory to PATH
This file contains hidden or 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
import sys | |
import os | |
# Define the path to add to sys.path, such as the current working directory | |
print(os.getcwd()) | |
path_to_add = os.getcwd() | |
# Add the path_to_add to the system path | |
if path_to_add not in sys.path: | |
sys.path.append(path_to_add) | |
# Verify that the current directory is added to the system path | |
print(sys.path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment