- 博客(8)
- 收藏
- 关注
原创 《Think Python》练习4-5:用turtle画螺线
要求:阅读螺线(spiral)的相关知识; 然后编写一个绘制阿基米德螺线(或者其他种类的螺线)的程序。阿基米德螺线import turtlefrom math import sin, cos, pibob = turtle.Turtle() # create a Turtle objectbob.delay = 0.01 # 设置延迟值def spiral(t, a, n, w=...
2020-04-01 11:00:41
1146
1
原创 《Python编程快速上手—让繁琐工作自动化》第16章
##16.2 发送电子邮件import smtplibfrom_addr = input('输入新浪邮箱:')to_addr = input('输入收件人邮箱:')password = input('输入授权码:')smtp_server = 'smtp.sina.com'msg = """to:%sfrom:%sSubject:Hello\nHello! This is ...
2020-02-23 12:27:57
476
原创 《Python编程快速上手—让繁琐工作自动化》第15章实践项目
##15.12.1 美化的秒表import time,pyperclipprint('Press ENTER to begin. Afterwards, press ENTER to click the stopwatch,\Press Ctrl-C to quit.')input()print('Started')startTime = time.time()lastTime =...
2020-02-20 16:19:45
363
原创 《Python编程快速上手—让繁琐工作自动化》第14章实践项目
##14.8 Excel 到 CSV 的转换程序from openpyxl import load_workbookimport csv,osfor excelFile in os.listdir('.'): if not excelFile.endswith('.xlsx'): continue wb = load_workbook(excelFile,d...
2020-02-18 19:52:58
198
原创 《Python编程快速上手—让繁琐工作自动化》第13章实践项目
##13.6.1 PDF偏执狂import os,PyPDF2,sysos.chdir(r'C:\Users\Yuno\Desktop')for foldername,subfoldernames,filenames in os.walk('.'): #遍历当前工作目录找到pdf文件 for filename in filenames: if filename.en...
2020-02-18 19:45:10
441
原创 《Python编程快速上手—让繁琐工作自动化》第12章实践项目
##12.13.1 乘法表###法一from openpyxl.workbook import Workbookfrom openpyxl.styles import Fontn = int(input('Put an integer :'))wb = Workbook()ws = wb.activews.freeze_panes = 'B2'f = Font(bold=True...
2020-02-16 18:36:02
638
4
原创 《Python编程快速上手—让繁琐工作自动化》第9章实践项目
##9.8.1选择性拷贝import os, shutildirection = os.path.join(os.getcwd(), 'copylist')os.makedirs(direction) for foldername, subfoldernames, filenames in os.walk(r"...
2020-02-08 19:40:22
191
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人