4 ms·
Command Line Hack: Locate the Source for any Python Module
- danohuiginn 17y agoeggs won't work with this. Then again, eggs won't work with _anything_
- j_baker 17y agoThe pip unzip command works wonders for this. It converts a zipped egg into a plain old package. There are two other situations where this can cause problems: * The module is a C extension (which might not have the __file__ attribute defined). * The module is actually a namespace package (for example "zope" in "zope.package" and "zope.interface".
- fs111 17y agohttp://www.vim.org/scripts/script.php?script_id=910 http://www.vim.org/scripts/script.php?script_id=910
- jbert 17y agoOr for any scripting language, use you can use strace. e.g. to find CGI.pm in perl: $ strace -e open perl -MCGI -e exit 2>&1 > /dev/null | grep CGI.pm | sed -e 's/",.$//' -e 's/^."//' /usr/share/perl/5.10/CGI.pm 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? [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)?]
- deleted 17y ago[deleted]