Copy Code code as follows:
##########################
# #
# to avoid truncating Chinese characters #
# File requirements are Unicode code #
# TXT file Save As dialog box with Drop-down box below, optional save #
# stored Code format #
# #
##########################
Import OS
Import struct
filename = str (raw_input ("Please enter the old file name:")
Filenamepre = str (raw_input ("Please enter a new file name prefix:")
Count = 0
FileCount = 0
Maxcount = 20
NewFileName = repr (filecount) + '. txt '
Oldfile = open (filename, ' RB ')
Bfirst = True
While True:
s = Oldfile.read (512*8-4)
If not s:
Exit ()
FileCount = FileCount + 1
NewFileName = Filenamepre + repr (filecount). Zfill (2) + ' txt '
NewFile = open (NewFileName, ' WB ')
If not bfirst:
be = 0XFEFF
Newfile.write (Struct.pack (' H ', Be))
Newfile.write (s)
be = 0x000a000d
Newfile.write (Struct.pack (' I ', Be))
Newfile.close ()
Bfirst = False
Oldfile.close ()