I am writing a program in Python, and want to get it to make the OS open the current working directory, making for instance Windows open explorer.exe and navigating to the wanted directory. Any ideas on how to do this?
The directory is already given by os.getcwd.
Cross platform methods preferred 🙂
There is os.startfile, but it’s only available under windows:
Here someone (credits to Eric_Dexter@msn.com apparently) posted an alternative for use on unix-like systems, and someone mentions the desktop package available at pypi (but i’ve never used it). The suggested method:
So to complete the answer, use: