![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python学习笔记
python学习笔记
weixin_35695688
这个作者很懒,什么都没留下…
展开
-
1.(2021-01-12)python爬虫下载百度小说贴吧图片
import requestsfrom bs4 import BeautifulSoupimport os,statimport urllib.requestheaders = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36"}# res = requests.get('http://t原创 2021-01-12 11:56:03 · 162 阅读 · 0 评论 -
python 移位符<< 乘10功能
if __name__ == '__main__': # print(number_length(4553)) c = 10 a = 1 b = 1 while c > 1: a = (a << 3) + (a << 1) b = b * 10 print("a = %d,b = %d"%(a,b)) c -= 1a = 10,b = 10a = 100,b = 100原创 2021-04-08 17:21:54 · 174 阅读 · 0 评论 -
python excel多个sheet合并,添加列
# -*- coding = utf-8 -*-# @Time:2021/3/3015:34# @Author:Molly# @File:Unit.py# @Software:PyCharmfrom zipfile import BadZipFilefrom openpyxl import load_workbookimport pandas as pdfrom openpyxl.utils.exceptions import InvalidFileExceptionfrom panda原创 2021-04-01 15:28:29 · 378 阅读 · 0 评论 -
python list去重
'''一、已知:商品list(商品名称、价格)二、目的(1)打印出商品列表,表头为商品编码(下标索引)、商品名称、商品价格、数量(2)不断提示用户输入要购买商品的编码, 用户输入一次商品编码就把商品加入到购物车(list),重新提示。 输入错误,重新提示。 输入q,退出程序,并打印购物车商品名称、单价、数量、合计'''products = [[0,"iphone",6888,1],[1,"macpro",14800,1],[2,"小米6",2499,1],[3,"coff原创 2021-03-12 11:20:39 · 45 阅读 · 0 评论 -
python老师随机分配办公室
import random# 三个空的办公室offices=[[],[],[]]# 8个老师name=['a','b','c','d','e','f','g','h']# 把8个老师随机分配到3个办公室中for n in name: #生成0-2的随机数,作为offices的下标 index=random.randint(0,2) #在office中追加数据 offices[index].append(n)i=1for office in offices:原创 2021-03-12 08:38:01 · 612 阅读 · 0 评论 -
python99乘法表
for i in range(1,10): for j in range(1,i+1): print(i,"*",j,"=",i*j,end="\t") print()1 * 1 = 1 2 * 1 = 2 2 * 2 = 4 3 * 1 = 3 3 * 2 = 6 3 * 3 = 9 4 * 1 = 4 4 * 2 = 8 4 * 3 = 12 4 * 4 = 16 5 * 1 = 5 5 * 2 = 10 5 * 3 = 15 5 * 4 = 20 5 * 5原创 2021-03-12 08:21:26 · 68 阅读 · 0 评论 -
pycharm设置默认模板内容
File----settings----editor----file and code templates翻译 2021-03-11 16:01:09 · 136 阅读 · 0 评论 -
pycharm代码同步到GitHub上
一、环境搭建1.下载git,安装https://git-scm.com2.GitHub添加本机的ssh keygit分布式代码管理,远程代码管理基于ssh,要配置好ssh key配置步骤(1)(2)3.在pycharm中设置(1)File—setting—version control—git查看path中是否已经安装好git,点击test查看git版本(2)File—setting—version control—github登录账号二、GitHub上没有对应代码仓库,需要新建代原创 2021-02-01 14:56:16 · 217 阅读 · 0 评论 -
(1)2020-11-10python开发环境介绍
1.计算机组成cpu、内存、硬盘的关系cpu:运算数据内存:存放cpu运算的临时数据,断电不保存硬盘:存放数据,断电保存2.python解释器解释器作用:翻译官,将python代码文件翻译成计算机可以运行的文件解释器种类种类说明CPythonC语言开发的解释器[官方],应用广泛的解释器IPython基于CPython的一种交互式解释器PyPy基于Python语言开发的解释器Jython运行在Java平台的解释器,直接把Python代码编译成Jav原创 2020-11-13 07:03:50 · 49 阅读 · 0 评论