Why is there module search path instead of typing the directory name + typing the file name?
-
19-09-2019 - |
Question
Is there an advantage? What is it?
Solution
So that everyone doesn't need to have exactly the same file structure on their hard drive? import C:\Python\lib\module\
probably wouldn't work too well on my Mac...
Edit: Also, what the heck are you talking about with the working directory? You can certainly use modules outside the working directory, as long as they're on the PYTHONPATH
.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow