3 ms·
os.path.realpath(__file__) That will give you the absolute path of the current python script, dereferencing any symlink and the .. notation.
by user5994461 7y ago
os.path.realpath(__file__)
That will give you the absolute path of the current python script, dereferencing any symlink and the .. notation.
- mehrdadn 7y agoIt will also be insecure due to a race condition.