python 要点

1.python的发展及应用

1.1python的发展:

  • Python从2014开始排名逐渐上涨
  • Python在2017年排名第四位
  • 2018年开始由于人工智能(阿尔法狗),Python突飞猛进
  • 2020年python排名第二,仅次于JAVA,超过了C/C++

1.2python的应用:

  • 常规软件开发
  • 科学计算
  • 自动化运维
  • 自动化测试
  • WEB开发
  • 网络爬虫
  • 数据分析
  • 机器学习
  • 深度学习
  • 人工智能

1.3python之禅(中英文)

  • 在python的IDLE中输入:import this

1.3.1:python之禅(英文)

The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

1.3.2:python之禅(中文)

优美胜于丑陋
明了胜于晦涩
简洁胜于复杂
复杂胜于凌乱
扁平胜于嵌套
间隔胜于紧凑
可读性很重要
即便假借特例的实用性之名,也不可违背这些规则
不要包容所有错误,除非你确定需要这样做
当存在多种可能,不要尝试去猜测
而是尽量找一种,最好是唯一一种明显的解决方案
虽然这并不容易,因为你不是 Python 之父
做也许好过不做,但不假思索就动手还不如不做
如果你无法向人描述你的方案,那肯定不是一个好方案;反之亦然
命名空间是一种绝妙的理念,我们应当多加利用

2:搭建环境

2.1:python的交互模式

  • WIN + R —> CMD —> 回车 —> 输入Python

2.2:pip的使用

  • 在命令行下输入pip然后回车可以看到帮助使用
  • 查看pip的版本
    pip -V
    pip -version
  • 使用普通的pip方式安装库
    pip install 库名
  • 指定版本安装
    pip install robotframework==2.8.7
  • 卸载已安装的库
    pip uninstall 库名
  • 列出已安装的库
    pip list
  • 显示所安装包的信息
    pip show package
  • 将已安装的库保存到文本文件中
    pip freeze > D:\Desktop\install.txt
  • 批量下载导出来的包
    pip install -r packages.txt
  • 换源安装
    pip install package -i http://pypi/douban.com/simple
  • 换源安装的网址:

3:pycharm的安装

3.1:Pycharm的配置

  • 主题修改
    File–settings–apperance–theme
  • 字体修改
    File–settings–Editor-Font
  • 关闭更新
    File–settings—apperance—System Settings — Updates — Automatically check updates for 取消打钩
  • 自动导包
    File–settings—apperance–General —Auto Import 打钩
  • 禁止打开上次的工程
    File–settings—apperance—System Settings —Reopen last project startup
  • 修改新建文件文件头
    File–settings–Editor—Code Style — File and Code Templates — Python Script
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值