caioariede / pyq

A CLI tool to search for Python code in a path using jQuery-like selectors.
MIT License
127 stars 3 forks source link

Allow getting import path #2

Open sametmax opened 8 years ago

sametmax commented 8 years ago

A lot of time you want to know where is a specific definition so you can import it. Providing an option to print the import path would be fantastic:

pyq3 "#init_cmd" myvirtualenv -i # -i print import path
[foo.bar.init_cmd] ......./site-packages/foo/bar.py :111 def init_cmd(args) 

Or even no option and make it the default behavior.

caioariede commented 8 years ago

I'm not really convinced this should be integrated into the tool or a plugin for code editors.

sametmax commented 8 years ago

The whole purpose of tools like yours is to follow the unix philosophy of "use the OS as your IDE". Even if you don't though, It is particularly useful when you ssh remote on a server and explore the code in the terminal while testing in the shell.