I am trying to write a file in the/usr/bin path so that my program can be ran from anywhere.
This is the code
os.chdir("/usr/bin")
writetofile("slang", "cd " + pdir + " && python3 slang.py $1 $2 $3")
And pdir is set with os.getcwd()
However, it gives me an error.
FileNotFoundError: [WinError 3] The system cannot find the path specified: '/usr/bin'
I tried removing the "/" but that didn't work either.
And I can't include the full path to /usr/bin because the MSYS2 path might not be the same for everybody.
How do I get Python to change the CWD to /usr/bin?
After running python -m site
I get this output:
sys.path = [
'C:/msys64/home/*me*',
'C:/msys64/mingw64/lib/python310.zip',
'C:/msys64/mingw64/lib/python3.10',
'C:/msys64/mingw64/lib/python3.10/lib-dynload',
'C:/msys64/mingw64/lib/python3.10/site-packages',
]
USER_BASE: 'C:/Users/*me*/.local' (doesn't exist)
USER_SITE: 'C:/Users/*me*/.local/lib/python3.10-mingw_x86_64/site-packages' (doesn't exist)
ENABLE_USER_SITE: True