我正在阻止我尝试做的Python练习!
我听不懂,但这是我的第一次尝试:
import sys, re
text = open (sys.argv [1], 'r', encoding = "utf-8")
output = open ("res.txt", "w", encoding = "utf-8")
dic = {}
long = int (sys.argv [2])
freq = int (sys.argv [3])
for i in text:
a = re.split ("\ w", i.lower ())
l = zip (a [i:] for i in range (long))
for j in l:
dic [j] = dic.get (j, 0) 1
for k in sorted (dic):
if dic.get (k) == freq:
output.write ("". join (K) "" str (dic.get (K)))