My Unix config files and shell scripts, optimized for Fedora, Debian, macOS and Windows (in that order).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
571 B

#!/usr/bin/env python
# pywhich - Find out where a Python module lives.
# Works like `which` but for Python modules.
# Usage: pywhich
# --Kirsle
from __future__ import print_function
from sys import argv, exit
from importlib import import_module
if len(argv) == 1:
print("Usage: {} <>".format(argv[0]))
for module in argv[1:]:
mod = import_module(module)
print("{}: {}".format(module, mod.__file__))
except ImportError:
print("{}: not found".format(module))