摘要:
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) 阅读全文
摘要:
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)) 阅读全文
摘要:
def import_txt(): fileName = QFileDialog.getOpenFileName(self, "", "C:\\Users\\Administrator\\Desktop") if fileName[0]: ret = [] with open(fileName[0], "r", encoding="utf-8") ... 阅读全文