随笔分类 -  Python

摘要:参看文档:https://www.cnblogs.com/forever-snow/p/8506746.html 阅读全文
posted @ 2019-01-03 17:23 彩色的梦 阅读(498) 评论(0) 推荐(0)
摘要:import threading from time import ctime,sleep def music(func): for i in range(2): print("I was listening to %s. %s" %(func,ctime())) sleep(1) def move(func): for i in range... 阅读全文
posted @ 2018-12-28 16:20 彩色的梦 阅读(117) 评论(0) 推荐(0)
摘要:import re import os import urllib #根据给定的网址来获取网页详细信息,得到的html就是网页的源代码 def getHtml(url): page = urllib.request.urlopen(url) html = page.read() return html.decode('UTF-8') def getImg(html)... 阅读全文
posted @ 2018-12-27 10:34 彩色的梦 阅读(517) 评论(0) 推荐(0)
摘要:百分比滑动进度,sys.stdout()函数。 阅读全文
posted @ 2018-09-27 21:25 彩色的梦 阅读(128) 评论(0) 推荐(0)
摘要:利用字符串的形式去对象中寻找成员 导入单个模块: commons为公共模块,inp为输入 func=getattr(commons,inp) 利用反射最大的好处是不用单个单个导入,而通过getattr()可以实现多个直接导入。 导入多个模块: m,f=inp.split('/'),m是模块,f是方法 阅读全文
posted @ 2018-09-25 21:33 彩色的梦 阅读(141) 评论(0) 推荐(0)