随笔分类 -  Python

摘要:示例库: python-ldap 系统: Microsoft Windows [版本 10.0.18363.836] Python版本: Python 3.7.4 pip版本: pip 20.1.1 常规流程 pip安装: pip install python-ldap 安装报错, 大概意思就是缺少 阅读全文
posted @ 2020-07-05 09:32 Nonevx 阅读(637) 评论(0) 推荐(0)
摘要:当更新安装Python时, 卸载之前的安装, 会连带pip之前安装的库文件一同卸载, 可以使用命令导出已安装的库的列表到文件, 等安装完新的Python后, 在通过文件批量安装库文件 1.导出安装列表到文件 pip freeze > requirements.txt 2.通过文件批量安装库文件(使用 阅读全文
posted @ 2020-07-05 09:13 Nonevx 阅读(1025) 评论(0) 推荐(0)
摘要:本文环境 系统: Windows10 Python版本: 3.6 安装 "python安装包下载" 可以选择安装版和解压版 安装版一键安装, 安装过程注意选择安装位置, xx To Path选项(勾选), 和是否安装pip选项(选择安装) 解压版需要手动 "配置环境变量" 在命令行输入以下命令确认是 阅读全文
posted @ 2019-04-20 09:23 Nonevx 阅读(2626) 评论(0) 推荐(0)
摘要:```python # coding=utf-8 print ('\n'.join(['*'*6 for i in range(4)])) # ****** # ****** # ****** # ****** print ('\n') print ('\n'.joi... 阅读全文
posted @ 2019-04-19 09:22 Nonevx 阅读(1045) 评论(0) 推荐(0)
摘要:```python # 全部小写 string.lower() # 全部大写 string.upper() # 是否全部小写 string.islower() # 是否全部大写 string.isupper() # 首字母大写 string.capitalize() # 大小写转换 string.swapcase() # 检查字符串是否是以 str 开头 string.startswith(str... 阅读全文
posted @ 2019-04-15 13:58 Nonevx 阅读(716) 评论(0) 推荐(0)
摘要:```python a = 1 b = a a = 2 print(a, b) print(id(a), id(b)) """ 运行结果 2 1 1445293568 1445293536 """ # 列表直接复赋值给列表不属于拷贝, 只是内存地址的引用 list1 = ["a", "b", "c"] list2 = list1 list1.append("d") print(list1, li... 阅读全文
posted @ 2019-04-14 14:29 Nonevx 阅读(2717) 评论(0) 推荐(0)
摘要:前言 list: Python3的列表类型, 和其他语言中的数组类似 定义格式: l = ["a", "b", "c", "a", "b", "c", "a"] , 下文举例用到的列表x为此列表 list常用方法(文章中用到的方法): index(元素[, Start[, Stop]]) : 获取列 阅读全文
posted @ 2019-04-12 14:44 Nonevx 阅读(15777) 评论(2) 推荐(0)