Re: [Tutor] Multiple file open

2010-08-20 Thread nitin chandra
Thank You Very Much :) Walter. It WOrked I did the "except" closing. Thanks Nitin On Sat, Aug 21, 2010 at 2:17 AM, Walter Prins wrote: > > Hello Nitin, > > On 20/08/10 16:21, nitin chandra wrote: >> >> import sys,os, fileinput >> > > [...] >> >> while True: >>    try: >>        line1 =

Re: [Tutor] Multiple file open

2010-08-20 Thread Walter Prins
Hello Nitin, On 20/08/10 16:21, nitin chandra wrote: import sys,os, fileinput [...] while True: try: line1 = fp1.readline().split(",") line2 = fp2.readline().split(",") [...] fp3.write(str3) You're missing the completion for the try/finally block. Tr

Re: [Tutor] Multiple file open

2010-08-20 Thread nitin chandra
import sys,os, fileinput FileA = raw_input('Enter CSV file with lists of Files:') try: fp6 = open(FileA,'r') except IOError: sys.exit('Could not open file: %s' % FileA) while True: lines = fp6.readline().split(",") file11 = lines[0] file12 = lines[1] file3 = lines[2] #file11 =

Re: [Tutor] Multiple file open

2010-08-20 Thread Steven D'Aprano
On Fri, 20 Aug 2010 06:27:01 pm nitin chandra wrote: > Thank you, Alan and Steven. > > Now i am facing some thing 'different' > > This is even when i have not done a carriage return to create line > "66". This is after i have done > fp1.close() > fp2.close() > fp3.close() >

Re: [Tutor] Multiple file open

2010-08-20 Thread nitin chandra
Thank you, Alan and Steven. Now i am facing some thing 'different' This is even when i have not done a carriage return to create line "66". This is after i have done fp1.close() fp2.close() fp3.close() ** File "mer5Pr2.py", line 66

Re: [Tutor] Multiple file open

2010-08-20 Thread Alan Gauld
"nitin chandra" wrote FileA = raw_input('Enter CSV file with lists of Files:') try: fp6 = open(FileA,'r') except IOError: ## I am getting the following error at this line:- ## ##File "mer5Pr2.py", line 7 ##except IOError: ##^ ##SyntaxError: invalid syntax The

Re: [Tutor] Multiple file open

2010-08-20 Thread Steven D'Aprano
On Fri, 20 Aug 2010 05:28:42 pm nitin chandra wrote: > try: >fp6 = open(FileA,'r') >except IOError: You need to outdent the except line: try: fp6 = open(FileA,'r') except IOError: sys.exit('Could not open file: %s' % FileA) -- Steven D'Aprano

Re: [Tutor] Multiple file open

2010-08-20 Thread nitin chandra
Hello All, I am getting the "Invalid Syntax" error. I am on Python 2.6. Thanks In Advance Nitin import sys,os, fileinput FileA = raw_input('Enter CSV file with lists of Files:') try: fp6 = open(FileA,'r') except IOError: ## I am get

Re: [Tutor] Multiple file open

2010-08-19 Thread nitin chandra
Hello All, >> Please guide with the syntax. > > All beginners tutorials on the web teach the syntax of python.. I am > unsure what your questions is. My bad with code. > >> below is the existing program with Formula A (Mean). Formula B will be >> Extrapolation, >> also I have not been abl

Re: [Tutor] Multiple file open

2010-08-18 Thread Sander Sweers
On 18 August 2010 17:14, nitin chandra wrote: > I am on Python 2.6 > > Please guide with the syntax. All beginners tutorials on the web teach the syntax of python.. I am unsure what your questions is. > below is the existing program with Formula A (Mean). Formula B will be > Extrapolation, > a

[Tutor] Multiple file open

2010-08-18 Thread nitin chandra
Hi All, @ Alan - Thank you. Your suggestion worked. ( read 2 input file and 1 output file). I am on Python 2.6 I need to process two sets of 96 files and prepare equal no. of sets of 96 files. The first set of 96 files have a formula A and second set of 96 files have formula B. Formula A is deri