12 2021 档案
摘要:1、字符串前加 u 例:u"我是含有中文字符组成的字符串。" 作用:后面字符串以 Unicode 格式 进行编码,一般用在中文字符串前面,防止因为源码储存格式问题,导致再次使用时出现乱码。 2、字符串前加 r 例:r"\n\n\n\n” # 表示一个普通生字符串 \n\n\n\n,而不表示换行了。
阅读全文
该文被密码保护。
摘要:urls=[ f"https://www.cnblogs.com/sitehome/p/{page}" for page in range(1,5+1) ] print(urls) ['https://www.cnblogs.com/sitehome/p/1', 'https://www.cnblo
阅读全文
摘要:df['原价']=pd.factorize(df["原价"])[0].astype(float) df['原价']=pd.factorize(df["原价"])[0].astype(int)
阅读全文
摘要:import requests as r from lxml import etree import re,os,random,time url='http://xxx.com/xx' res=r.get(url) html=etree.HTML(res.text) title=html.xpath
阅读全文
摘要:【加油的时候别加满了】 40升的油箱加个35就行了,估计跑的公里数差不多,在航空领域这个现象叫“油耗油”,别白浪费钱,还污染环境。 【正常行驶时,前车突然并线给你让路,绝对没好事】 咱们现在的司机还没这个觉悟,千万别给油超车,最好马上松油预备刹车,同时迅速观察两侧后视镜,判断出如果要并线往哪边并,八
阅读全文
摘要:import random,time sleeptime=random.randint(3, 5) time.sleep(sleeptime)
阅读全文
摘要:""" utf8 编码""" from urllib.request import quote, unquote url1 = "https://www.baidu.com/s?wd=百度" # utf8编码,指定安全字符 ret1 = quote(url1, safe=";/?:@&=+$,",
阅读全文
摘要:import os ... fname='xxx.csv' if not os.path.exists(fname): #文件存在则写表头 header默认=True df.to_csv(fname,mode='a',encoding='utf-8-sig',index=False,index_la
阅读全文
摘要:一、起步 可结合投屏更方便开发:https://www.cnblogs.com/chenxi188/p/15645017.html 手机安装autojs 4.1.1版 功能全 不收费 阿里云盘有 1)vscode内输入autojs安装以下两个插件: 2)ctrl+shift+p 调出面板 autoj
阅读全文