p0002 python查看源码

如何查看外部模块在哪以及如何打印出源代码?

1
2
3
4
import random 
print(random.__file__)
with open(str(random.__file__),"r") as f:
print (f.read())

最简单就安装VSCode.