coding: core code # -*- UTF-8 -*- 'Python English read files, each word according to space separated, and each word alone put a line' def dcfenhang (infile, outfile): infopen = open (infile,'r', encoding='utf-8') OUTOPEN = open (outfile,'w', lines = infopen.readlines (encoding='utf-8') line in lines: for) for DB in (line.split): if DB not in outfile: outopen.write (db+'n') infopen.close (outopen.close) (dcfenhang) ("jb51.txt", "fenci.txt") 

jb51.txt

welcome to visit jb51.net
file

Thans very much

></p>
<p>


This concludes the body part

This paper fixed link:http://www.script-home.com/python-separates-each-word-by-space-and-saves-it-to-the-file.html | Script Home | +Copy Link

Article reprint please specify:Python separates each word by space and saves it to the file | Script Home

You may also be interested in these articles!