Method 1: Use Help (Random)
Import random>>> Help on module Random:name - random variable generators. file c:\python27\lib\random.py # files store location
Method 2: Use random.__file__ to view the location, and then open the file with the suffix. Py Name
>>> Random. __file__ ' C:\\python27\\lib\\random.pyc ' # file storage location
Method 3: The command line enters Python-v and then the position is automatically displayed when the module is poured
C:\users\administrator>python-v#Installing Zipimport HookImportZipimport#Builtin#Installed Zipimport Hook#C:\PYTHON27\LIB\SITE.PYC matches C:\Python27\lib\site.py # file storage location ImportSite#precompiled from C:\Python27\lib\site.pyc#C:\PYTHON27\LIB\OS.PYC matches C:\Python27\lib\os.pyImportOs#precompiled from C:\Python27\lib\os.pycImportErrno#Builtin............... Omitted.......................................
Python View function code content