Skip to content

Instantly share code, notes, and snippets.

@MattWoodhead
Created June 25, 2017 14:21
Show Gist options
  • Save MattWoodhead/8acd76c7bda55031e12b8cf3ceeb7c3b to your computer and use it in GitHub Desktop.
Save MattWoodhead/8acd76c7bda55031e12b8cf3ceeb7c3b to your computer and use it in GitHub Desktop.
Open windows explorer with a specific folder or file selected
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