随笔分类 - Python
摘要:1、最简洁方法response:直接请求response.getcode():获取状态码response.read():读取内容 #coding:utf8import urllib2url = "http://www.baidu.com"print '第一种方法're...
阅读全文
摘要:#coding:utf8from bs4 import BeautifulSouphtml__doc = """The Dormouse's storyThe Dormouse's storyOnce upon a time there were three litt...
阅读全文
摘要:目录 1、使用copy模块来复制2、keyword模块记录了所有的关键字3、用random模块获得随机数4、用sys模块来控制Shell程序5、用time模块来得到时间6、用pickle模块来保存信息1、使用copy模块来复制>>> class Animal: ...
阅读全文
摘要:目录 1、abs函数2、bool函数3、dir函数4、eval函数5、exec函数6、float函数7、int函数8、long函数9、max和min函数10、range函数11、sum函数12、文件的使用1、abs函数abs(10) abs(-10)2、bool...
阅读全文
摘要:1、这里实现一个小球类,考虑了边界碰撞。 from tkinter import *import randomimport timeclass Ball: def _init_(self, canvas, color): self.canvas =...
阅读全文

浙公网安备 33010602011771号