摘要: import re number = "123456789" result = re.findall("\d{1,2}", number) print(result) # ['12', '34', '56', '78', '9']import textwrap s = ' '.join(textwrap.wrap(text='123456', width=2))print(s) 阅读全文
posted @ 2018-11-06 13:49 疯狂的骆驼 阅读(130) 评论(0) 推荐(0) 编辑
摘要: from itertools import permutations s = list(permutations('1234')) a = [list(i) for i in s] s2 = ["".join(i) for i in a] print(s2) print(len(s2)) 阅读全文
posted @ 2018-11-06 00:21 疯狂的骆驼 阅读(126) 评论(0) 推荐(0) 编辑
摘要: def import_txt(): fileName = QFileDialog.getOpenFileName(self, "", "C:\\Users\\Administrator\\Desktop") if fileName[0]: ret = [] with open(fileName[0], "r", encoding="utf-8") ... 阅读全文
posted @ 2018-11-06 00:14 疯狂的骆驼 阅读(245) 评论(0) 推荐(0) 编辑