I was once stucked in How to check Whether a Python module has been installed or not. After Googling, I found this trick.
Python allows user to pass command from out of a python file.See here
1
| |
The result if we import an installed module
1 2 3 4 | |
Now if we import an module which is not installed.
1 2 3 4 5 6 7 | |
本文介绍了一种使用Python脚本来检查特定模块是否已安装的方法,通过运行Python脚本并捕获输出来判断模块是否存在。
31万+

被折叠的 条评论
为什么被折叠?



