Created
June 25, 2017 14:21
-
-
Save MattWoodhead/8acd76c7bda55031e12b8cf3ceeb7c3b to your computer and use it in GitHub Desktop.
Open windows explorer with a specific folder or file selected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
def explorer_on_file(url): | |
""" opens a windows explorer window """ | |
subprocess.Popen(f'explorer /select,"{url}"') | |
explorer_on_file(r"C:\Python\python.exe") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
awesome. this not only opens the windows explorer at the right folder, but also selects the file specified. Thanks!