Created
August 28, 2012 04:43
-
-
Save OmniZ3D/3495019 to your computer and use it in GitHub Desktop.
Select current python file in explorer
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
# Select current python file in explorer | |
import os, sys, subprocess, inspect | |
subprocess.Popen(r'explorer /select,%s' % os.path.abspath(inspect.getfile(inspect.currentframe()))) | |
## or... | |
pFileName = os.path.abspath(inspect.getfile(inspect.currentframe())) | |
pFileDir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) | |
print 'pFileName = %s\n' % pFileName | |
print 'pFileDir = %s' % pFileDir | |
subprocess.Popen(r'explorer /select,%s' % pFileName) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment