python-3.7.0.rar
链接:https://pan.baidu.com/s/1Gl5QUMrLFoTekENighd0iw
提取码:ysgx
pycharm5.0.3.zip
链接:https://pan.baidu.com/s/1DpzRiMWSW2byWjB1cYmQKw
提取码:9rgi
Anaconda3 jupyter notebook
第一步进入: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
第二步选择: Anaconda3-5.3.1-windows-x86_64.exe 632.5Mib 2018-11-20 04:04
或者点击链接直接下载: https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.1-Windows-x86_64.exe
python 学习路径资料.zip
链接:https://pan.baidu.com/s/1G3FDtEnK-akbjkHn79Kw9w
提取码:yw1j
python3 爬虫实践
链接:https://pan.baidu.com/s/1wY0xTx7ujl48b0eSkvaOWA
提取码:4b9n
python 电子书
链接:https://pan.baidu.com/s/1AsUWdJjtooGT5DhIdrsSrQ
提取码:bmiv
九九乘法表
print('\n'.join([' '.join(["%2s x%2s = %2s"%(j,i,i*j) for j in range(1,i+1)]) for i in range(1,10)]))
心形字图
print('\n'.join([''.join([('AdamCY888'[(x-y) % len('AdamCY888')] if ((x*0.05)**2+(y*0.1)**2-1)**3-(x*0.05)**2*(y*0.1)**3 <= 0else' ')for x in range(-30, 30)]) for y in range(30, -30, -1)]))
代码小妙招
批量更改照片文件名
import os ##初次接触python,要学会如何安装第三方库
import string
dirName = "C:/Users/AdamCY/Desktop/tiantian\\" #将引号内的地址改为本地文件存储地址
li=os.listdir(dirName)
for filename in li:
newname = filename
newname = newname.split(".")
if newname[-1]=="png":
newname[-1]="jpg"
newname = str.join(".",newname) #这里要用str.join
filename = dirName+filename
newname = dirName+newname
os.rename(filename,newname)
print(newname,"updated successfully")
#主函数调用
if __name__ == '__main__':
demo = BatchRename()
demo.rename()
运行代码实现录屏功能
# coding: utf-8
from PIL import ImageGrab
import numpy as np
import cv2
fps = 20
start = 3 # 延时录制
end = 15 # 自动结束时间
curScreen = ImageGrab.grab() # 获取屏幕对象
height, width = curScreen.size
video = cv2.VideoWriter('video02.avi', cv2.VideoWriter_fourcc(*'XVID'), fps, (height, width))
imageNum = 0
while True:
imageNum += 1
captureImage = ImageGrab.grab() # 抓取屏幕
frame = cv2.cvtColor(np.array(captureImage), cv2.COLOR_RGB2BGR)
# 显示无图像的窗口
cv2.imshow('capturing', np.zeros((1, 255), np.uint8))
# 控制窗口显示位置,方便通过按键方式退出
cv2.moveWindow('capturing', height - 100, width - 100)
if imageNum > fps * start:
video.write(frame)
# 退出条件
if cv2.waitKey(50) == ord('q') or imageNum > fps * end:
break
video.release()
cv2.destroyAllWindows()