Interview Questions

Where is the math.py (socket.py, regex.py, etc.) source file?

Python Questions and Answers


(Continued from previous question...)

Where is the math.py (socket.py, regex.py, etc.) source file?

There are (at least) three kinds of modules in Python:

1. modules written in Python (.py);
2. modules written in C and dynamically loaded (.dll, .pyd, .so, .sl, etc);
3. modules written in C and linked with the interpreter; to get a list of these, type:
import sys
print sys.builtin_module_names

(Continued on next question...)

Other Interview Questions