TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Command Line Hack: Locate the Source for any Python Module

10 pointsby mahipalabout 15 years ago

3 comments

fs111about 15 years ago
<a href="http://www.vim.org/scripts/script.php?script_id=910" rel="nofollow">http://www.vim.org/scripts/script.php?script_id=910</a>
jbertabout 15 years ago
Or for any scripting language, use you can use strace.<p>e.g. to find CGI.pm in perl:<p>$ strace -e open perl -MCGI -e exit 2&#62;&#38;1 &#62; /dev/null | grep CGI.pm | sed -e 's/",.<i>$//' -e 's/^.</i>"//'<p>/usr/share/perl/5.10/CGI.pm<p>Linux specific (use 'truss' on Solaris). I don't think OSX had strace like this last time I looked, but I assume dtrace could do a similar job if there isn't a more specific tool?<p>[Edit - there are literal asterisk chars in the above after the '.' chars in the regex, but I can't see a way to include them in a HN post (backslash escaping or HTML entities don't work)?]
评论 #1288433 未加载
danohuiginnabout 15 years ago
eggs won't work with this. Then again, eggs won't work with _anything_
评论 #1288627 未加载