2017年9月3日

使用pip下载/安装python模块

摘要: pip安装pyperclip模块 阅读全文

posted @ 2017-09-03 18:05 winecork 阅读(256) 评论(0) 推荐(0) 编辑

方法ljust/rjust/center

摘要: dict = {'apple':4,'banana':10,'pear':8} def printItem(dictName,leftwidth,rightwidth): print("Menu".center(leftwidth+rightwidth,'-')) for i,k in dictName.items(): print(i.ljust(leftwi... 阅读全文

posted @ 2017-09-03 16:43 winecork 阅读(91) 评论(0) 推荐(0) 编辑

字符串计数

摘要: import pprint text = "aaaa bbbb ccc dd ee ff gg h i j kkkk" count = {} for i in text: count.setdefault(i,0) count[i] = count[i] + 1 # pprint.pprint(count) print(pprint.pformat(count)) 阅读全文

posted @ 2017-09-03 15:51 winecork 阅读(96) 评论(0) 推荐(0) 编辑

导航