Created
December 5, 2012 21:44
-
-
Save anonymous/4219779 to your computer and use it in GitHub Desktop.
Open any python module in sublime, ie: pysubl django.contrib.auth
This file contains hidden or 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