Compound Condition WHILE Loop Syntax Error – How to fix❓ /u/SIGCPT Python Education
Compound Condition WHILE Loop Syntax Error – How to fix❓ /u/SIGCPT Python Education
#!/usr/bin/env python3
#readiwriteo.py
import os import pdb;
FI = open(‘/Users/PyDir/PYTxtInputestFile.txt’,’r’)
n = 0
n_incrementer = 0
n = int(input (“# of Rec Outs: “))
n_incrementer == n
While n != 0 and n_incrementer < n_incrementer + 1 :
”’
readiwriteo.py
While n != 0 and n_incrementer < n_incrementer + 1 :
SyntaxError:invalid syntax
”’
n -= 1
n_incrementer += 1
linei = FI.readline()
FO = open(‘/Users/PyDir/TesterOFile’+’_xl’ + str(n_incrementer) +’.txt’ ,’w’)
FO.write(linei)
print(linei.strip())
FO.close
My Objective is to write each line in the Input File starting w line 1 and creating an Output File identified with line number as part of the Output File.
And I am attempting to use an integer to limit the number of Input File Lines read and Output Files written.
And I can not figure out the correct syntax. Any assistance with this would be much appreciated?
submitted by /u/SIGCPT
[link] [comments]
r/learnpython #!/usr/bin/env python3 #readiwriteo.py import os import pdb; FI = open(‘/Users/PyDir/PYTxtInputestFile.txt’,’r’) n = 0 n_incrementer = 0 n = int(input (“# of Rec Outs: “)) n_incrementer == n While n != 0 and n_incrementer < n_incrementer + 1 : ”’ readiwriteo.py While n != 0 and n_incrementer < n_incrementer + 1 : SyntaxError:invalid syntax ”’ n -= 1 n_incrementer += 1 linei = FI.readline() FO = open(‘/Users/PyDir/TesterOFile’+’_xl’ + str(n_incrementer) +’.txt’ ,’w’) FO.write(linei) print(linei.strip()) FO.close My Objective is to write each line in the Input File starting w line 1 and creating an Output File identified with line number as part of the Output File. And I am attempting to use an integer to limit the number of Input File Lines read and Output Files written. And I can not figure out the correct syntax. Any assistance with this would be much appreciated? submitted by /u/SIGCPT [link] [comments]
#!/usr/bin/env python3
#readiwriteo.py
import os import pdb;
FI = open(‘/Users/PyDir/PYTxtInputestFile.txt’,’r’)
n = 0
n_incrementer = 0
n = int(input (“# of Rec Outs: “))
n_incrementer == n
While n != 0 and n_incrementer < n_incrementer + 1 :
”’
readiwriteo.py
While n != 0 and n_incrementer < n_incrementer + 1 :
SyntaxError:invalid syntax
”’
n -= 1
n_incrementer += 1
linei = FI.readline()
FO = open(‘/Users/PyDir/TesterOFile’+’_xl’ + str(n_incrementer) +’.txt’ ,’w’)
FO.write(linei)
print(linei.strip())
FO.close
My Objective is to write each line in the Input File starting w line 1 and creating an Output File identified with line number as part of the Output File.
And I am attempting to use an integer to limit the number of Input File Lines read and Output Files written.
And I can not figure out the correct syntax. Any assistance with this would be much appreciated?
submitted by /u/SIGCPT
[link] [comments] #!/usr/bin/env python3 #readiwriteo.py import os import pdb; FI = open(‘/Users/PyDir/PYTxtInputestFile.txt’,’r’) n = 0 n_incrementer = 0 n = int(input (“# of Rec Outs: “)) n_incrementer == n While n != 0 and n_incrementer < n_incrementer + 1 : ”’ readiwriteo.py While n != 0 and n_incrementer < n_incrementer + 1 : SyntaxError:invalid syntax ”’ n -= 1 n_incrementer += 1 linei = FI.readline() FO = open(‘/Users/PyDir/TesterOFile’+’_xl’ + str(n_incrementer) +’.txt’ ,’w’) FO.write(linei) print(linei.strip()) FO.close My Objective is to write each line in the Input File starting w line 1 and creating an Output File identified with line number as part of the Output File. And I am attempting to use an integer to limit the number of Input File Lines read and Output Files written. And I can not figure out the correct syntax. Any assistance with this would be much appreciated? submitted by /u/SIGCPT [link] [comments]