OmniZ3D
8/28/2012 - 4:43 AM

Select current python file in explorer

Select current python file in explorer

# 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)