The python dictionary is written in the table.

import os
from collections import Counter
sumsdata = []
for fname in os.listdir(os.getcwd()):
    if os.path.isfile(fname) and fname.endswith(".txt"):
        with open(fname,"r",encoding="utf-8") as fp:
            data = fp.readlines()
            fp.close()
        sumsdata += [line.strip().lower() for line in data]
cnt = Counter()
for word in sumsdata:
    cnt[word] += 1
cnt = dict(cnt)
print(cnt)
for key,value in cnt.items():
    dic = key + ":" + str(value)
    -sharp print(data)


".txt" is something like this {Beijing, China, Beijing, Shanghai, Chongqing
}

how to write data into a table to facilitate query

Mar.15,2021

print to txt, open with excle, select the delimiter:, export.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eab0eb-47dfc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eab0eb-47dfc.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?