Created
November 5, 2015 02:35
-
-
Save gormster/45bdc1d127b35b15d54d to your computer and use it in GitHub Desktop.
Inspect your python classes and methods in a variety of GUI text editors
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
def inspect_in(o, call): | |
import inspect | |
import subprocess | |
_, line = inspect.getsourcelines(o) | |
f = inspect.getsourcefile(o) | |
subprocess.call([x.format(filename=f, line=line) for x in call]) | |
def subl(o): | |
inspect_in(o, ['subl', '{filename}:{line}']) | |
def mate(o): | |
inspect_in(o, ['mate', '-l{line}', '{filename}']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You will need to have subl or mate in your
$PATH
.