python ways to get path code example
Example 1: get pyhton file path python
import os
os.path.realpath(__file__)
Example 2: get python script path
import os
def GetScriptPath():
return os.path.realpath(__file__);
print(GetScriptPath());
import os
os.path.realpath(__file__)
import os
def GetScriptPath():
return os.path.realpath(__file__);
print(GetScriptPath());