Last active
December 15, 2015 10:59
-
-
Save TimothyFitz/5250201 to your computer and use it in GitHub Desktop.
pysubl
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
#!/usr/bin/env python | |
import sys, os, os.path | |
sys.path.append('.') | |
# Weird hack, __import__("a.b.c") returns module a unless fromlist is non-empty, then it returns module c | |
filename = __import__(sys.argv[1], fromlist=["whatever"]).__file__ | |
os.system('subl ' + os.path.dirname(filename)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment