KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I had a file called example_file.py , which I wanted to use from various other files, so I decided to add example_file.py to sys.path and import this file in another file to use the file. To do so, I ran the following in IPython. import sys sys.path sys.path.append('/path/to/the/example_file.py') print(sys.path) I could see the path I had just added, and when I tried to import this file from another directory path like this: import example_file it worked just fine, but once I came out of IPython, entered it again, and checked the sys.path , I saw that the path which I had added was not present, so how do I add a path to sys.path permanently in Python?
Tags (comma-separated)
Save Edits
Cancel