Re: [Tutor] Help required

2013-04-04 Thread Mark Lawrence
First up please give a sensible subject, say "problem parsing csv file". I'm assuming the crud shown below is due to you posting in html, please use plain text instead. On 20/03/2013 06:12, Arijit Ukil wrote: I am new to python. My intention is to read the file digi.txt and store in separate

Re: [Tutor] Help required

2013-04-04 Thread Bod Soutar
On 20 March 2013 06:12, Arijit Ukil wrote: > I am new to python. My intention is to read the file digi.txt and store in > separate arrays all the values of each columns. However, the following > program prints only the last value, i.e. 1350696500.0. > Please help to rectify this. > > f = open ("di

Re: [Tutor] Help required

2013-04-04 Thread Mitya Sirenef
On 03/20/2013 02:12 AM, Arijit Ukil wrote: I am new to python. My intention is to read the file digi.txt and store in separate arrays all the values of each columns. However, the following program prints only the last value, i.e. 1350696500.0. Please help to rectify this. f = open (/"digi.txt"

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-12 Thread Alan Gauld
"Dave Angel" wrote But you have a serious bug in your code, that nobody in the first five responses has addressed. That while loop will loop over the first line repeatedly, till it reaches or exceeds 1000, regardless of the length of subsequent lines. Oooh, good catch, I completely miss

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread Dave Angel
ramya natarajan wrote: Hello, I am very beginner to programming, I got task to Write a loop that reads each line of a file and counts the number of lines that are read until the total length of the lines is 1,000 characters. I have to read lines from files exactly upto 1000 characters. Her

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread Alan Gauld
"spir ☣" wrote Either you read line per line, but then you cannot stop exactly at the 1000th character; or you traverse the text char per char, but this is a bit picky. Or you could just read 1000 chars from the file then pick out the lines from that. But that requires you to count newlin

Re: [Tutor] Help required to count no of lines that are until 1000characters

2010-05-11 Thread Alan Gauld
"ramya natarajan" wrote characters.But the problem is its reading entire line and not stopping excatly in 1000 characters. Do you really need to stop reading the file at 1000 characters rather than the line containing the 1000th character? That seems a very arbitrary sort of thing to do.

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread शंतनू
On 12-May-2010, at 12:32 AM, spir ☣ wrote: > On Tue, 11 May 2010 11:00:20 -0700 > ramya natarajan wrote: > >> Hello, >> >> I am very beginner to programming, I got task to Write a loop that reads >> each line of a file and counts the number of lines that are read until the >> total length of

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread spir ☣
On Tue, 11 May 2010 11:00:20 -0700 ramya natarajan wrote: > Hello, > > I am very beginner to programming, I got task to Write a loop that reads > each line of a file and counts the number of lines that are read until the > total length of the lines is 1,000 characters. I have to read lines fro

Re: [Tutor] Help required to count no of lines that are until 1000 characters

2010-05-11 Thread Luke Paireepinart
On Tue, May 11, 2010 at 1:00 PM, ramya natarajan wrote: > Hello, I have to read lines from > files exactly upto 1000 characters. >But the problem is its reading entire line and not stopping > excatly in 1000 characters. Can some one help what mistake i am doing here?. > >    log = open('/tmp/new.t

Re: [Tutor] Help required

2009-09-26 Thread waqas ahmad
t. I dont know how can i find only those pages where i have written only "CatInternational" line in the page. I shall be veryyyyyy thankful to you really for help. Best Regards, Waqas Date: Fri, 25 Sep 2009 15:39:27 -0600 Subject: Re: [Tutor] Help required From:

Re: [Tutor] Help required

2009-09-25 Thread vince spicer
On Fri, Sep 25, 2009 at 1:56 PM, waqas ahmad wrote: > > > Hi, > > I dont know it is the right place to post this question. I need help to > change one search code line . can you help me please. > > here is my search method code: > > search=re.compile("^#acl InternationalGroup.*\n", re.M).search(