镜像_win环境_python

python3

python官网
xp系统下载 python 3.44
win7/10下载 python3.66
安装特别提示:一路next + 添加环境
学习工具:pycharm 或者 anaconda 或者 sublime
cmd : win7 推荐 cmder(个人觉得很好用)

镜像库(下载国外库比较慢甚至被屏蔽)

国内镜像列表
http://pypi.douban.com/simple/ 豆瓣
http://mirrors.aliyun.com/pypi/simple/ 阿里
http://pypi.hustunique.com/simple/ 华中理工大学
http://pypi.sdutlinux.org/simple/ 山东理工大学
http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学
https://pypi.tuna.tsinghua.edu.cn/simple 清华
使用实例:
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple django
一劳永逸:
在你的“C:\Users\你的用户名\”目录下创建“pip”目录,“pip”目录下创建“pip.ini”文件(注意:以UTF-8 无BOM格式编码);
“pip.ini”文件内容:

[global]  
index-url=http://mirrors.aliyun.com/pypi/simple/  
[install]  
trusted-host=mirrors.aliyun.com  

注意:trusted-host 选项为了避免麻烦是必须的,否则使用的时候会提示不受信任,或者添加“--trusted-host=mirrors.aliyun.com”选项;
注意:有网页提示需要创建或修改配置文件(linux的文件在~/.pip/pip.conf,windows在%HOMEPATH%\pip\pip.ini),至少Windows7下“%HOMEPATH%\pip\pip.ini”这个目录是不起作用的。

安装库

进入cmd
if 已经配置一劳永逸:
pip3 install 库名
else:
pip3 install -i http://mirrors.aliyun.com/pypi/simple 库名

pyinstaller 生成exe

pip3 install -i http://mirrors.aliyun.com/pypi/simple pyinstaller
pyinstaller -F xxx.py #py程序打包
pyinstaller -F --paths=C:\Python\Python35\Lib\site-packages\PyQt5\Qt\bin
--paths=C:\Python\Python35\Lib\site-packages\PyQt5\Qt\plugins xxx.py
在打包之前务必找到第三方库的包(QtWidgets.py),把包复制到到跟 xxx.py同目录下,然后再使用以上2种方式打包,否则会打包失败或者即使打包成功,程序也会闪退。**
输入参数的含义
-F 表示生成单个可执行文件
-w 表示去掉控制台窗口,这在GUI界面时非常有用。
-p 表示你自己自定义需要加载的类路径,一般情况下用不到
-i 表示可执行文件的图标
给程序换图标的方法
输入命令中添加一个-i tubiao.ico(图标的相对路径)。如图:
pyinstaller -F -i tubiao\123. xxx.py #py程序打包**

常用库列表(此部分为复制粘贴)

standard libs:
re 正则
subprocess 调用shell命令的神器
pdb 调试
traceback 调试
pprint 漂亮的输出
logging 日志
threading和multiprocessing 多线程
urllib/urllib2/httplib http库,httplib底层一点,推荐第三方的库requests
os/sys 系统,环境相关
Queue 队列
pickle/cPickle 序列化工具
hashlib md5, sha等hash算法
cvs
json/simplejson python的json库
simplejson的性能要高于json
timeit 计算代码运行的时间等等
cProfile python性能测量模块
glob 类似与listfile,可以用来查找文件
atexit 有一个注册函数,可用于正好在脚本退出运行前执行一些代码
dis python 反汇编,当对某条语句不理解原理时,可以用dis.dis 函数来查看代码对应的python 解释器指令等等。

3th libs:
prettytable 表格输出
paramiko ssh python 库
selenium 浏览器自动化测试工具selenium的python 接口
lxml python 解析html,xml 的神器
mechanize Stateful programmatic web browsing
pycurl cURL library module for Python
Fabric Fabric is a Python (2.5 or higher) library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks
xmltodict xml 转 dict,真心好用
urllib3 和 requests: 当然其实requests就够了 Requests: HTTP for Humans
flask web 微框架
ipdb 调试神器,同时推荐ipython!结合ipython使用
redis redis python接口
pymongo mongodbpython接口
PIL python图像处理
mako python模版引擎
pandas
numpy , scipy 科学计算
matplotlib 画图
scrapy 爬虫
django/tornado/web.py/web2py/uliweb/flask/twisted/bottle/cherrypy.等等 python web框架/服务器
sh 1.08 — sh v1.08 documentation 用来运行shell 模块的 极佳选择

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值