- Joined
- Aug 31, 2010
- Messages
- 4
- Reaction score
- 0
Help,
when running a script, I keep getting an 'unexpected character after line continuation character' syntax error.
I thiink this is a function of me not constructing a string correctly.
Thanks.
Badger
#! /usr/bin/env python3.1...
# this splits a file laterally
fileout1 = open('c:/split_UPPPP1_.txt', 'w')
fileout2 = open('c:/split_UPPPP2_.txt', 'w')
fileIN = open('c:/UPPPP_.txt', 'r')
line = fileIN.readline()
while line:
line1 = line[1:80] + '\n\r'
line2 = line[80:160] + '\r'
name = "hhH"
record = str( 'r\", name, r\", ',', r\", line1, r\", ',', r\", line2, r\", \n')
#fileout1.write(line1,line2)
fileout2.write(record)
line = fileIN.readline()
fileIN.close()
fileout1.close()
fileout2.close()
print ('done')
when running a script, I keep getting an 'unexpected character after line continuation character' syntax error.
I thiink this is a function of me not constructing a string correctly.
Thanks.
Badger
#! /usr/bin/env python3.1...
# this splits a file laterally
fileout1 = open('c:/split_UPPPP1_.txt', 'w')
fileout2 = open('c:/split_UPPPP2_.txt', 'w')
fileIN = open('c:/UPPPP_.txt', 'r')
line = fileIN.readline()
while line:
line1 = line[1:80] + '\n\r'
line2 = line[80:160] + '\r'
name = "hhH"
record = str( 'r\", name, r\", ',', r\", line1, r\", ',', r\", line2, r\", \n')
#fileout1.write(line1,line2)
fileout2.write(record)
line = fileIN.readline()
fileIN.close()
fileout1.close()
fileout2.close()
print ('done')
Last edited: