// An highlighted block
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
File : 批量安装python第三方模块.py [1.0]
Time : 2020/09/20 21:43
Author : Jackey
Desc : 批量安装第三方模块,各模块以","分隔。本文件不保留版权,可任意修改使用。
Slogan : Life is short,you need Python.
'''
# Please write your code
# 加载模块
import os
# 定义函数
def os_order(word):
"""执行os命令"""
print(f"\n\t正在安装 {word} ,请稍等...")
os.system("pip install " + word +
" -i https://pypi.tuna.tsinghua.edu.cn/simple")# 直接调用清华镜像源
return
# 执行程序
file_path = "D:\\Jackey文档\\PythonCode2\\安装调试\\安装modules.txt" # 绝对路径
with open(file_path, 'r') as contents:
words = contents.read().split(",")
for word in words:
os_order(word) # 调用函数
print(f"\n\t{words} 安装完毕,谢谢!")
requests,selenium,lxml,beautifulsoup4,pyquery,pymysql,pymongo,redis,flask,django,jupyter,icrawler,qgrid,baostock,tushare,nodejs