3 ms·
You should use '__file__' for increased generality. Note that you can also import a module and refer to its location on disk as 'module.__file__'. I may or ma
by contravariant 7y ago
You should use '__file__' for increased generality.
Note that you can also import a module and refer to its location on disk as 'module.__file__'. I may or may not have used this to modify a few core python modules in place.