Re: Line indexing in Python

2009-12-18 Thread seafoid
Rory, You are a gentleman! Thank you very much for your suggestion! Kind Regards, Seafoid. Rory Campbell-Lange wrote: > > On 18/12/09, seafoid (fitzp...@tcd.ie) wrote: >> http://old.nabble.com/Parsing-file-format-to-ensure-file-meets-criteria-to26837682.html > > You

Re: Line indexing in Python

2009-12-18 Thread seafoid
o assign variables within a loop! Is there an easy way to 'flatten' a nested list and assign the lists to variables? Thanks, Seafoid. -- View this message in context: http://old.nabble.com/Line-indexing-in-Python-tp26845253p26849921.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating Classes

2009-12-18 Thread seafoid
Steve, that has indeed clarified matters! Thanks! -- View this message in context: http://old.nabble.com/Creating-Classes-tp26848375p26849864.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list

Creating Classes

2009-12-18 Thread seafoid
MutableSeq(self.data, self.alphabet) def count(self, item): return len([x for x in self.data if x == item]) I know what it should do, but have no idea how to feed it the data. Methinks I need to invest in actual computing books as learning from biologists is hazy! Kind regards, Seafoid

Re: Line indexing in Python

2009-12-18 Thread seafoid
!): http://old.nabble.com/Parsing-file-format-to-ensure-file-meets-criteria-to26837682.html Hope you guys may have some suggestions as I am stumped! Thanks, Seafoid :-) seafoid wrote: > > Hi Guys, > > When python reads in a file, can lines be referred to via an index? > > Example

Re: Line indexing in Python

2009-12-18 Thread seafoid
biologist :-( Thanks, Seafoid. -- View this message in context: http://old.nabble.com/Line-indexing-in-Python-tp26845253p26846854.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list

Re: Line indexing in Python

2009-12-18 Thread seafoid
lists_b = line.strip().split() print list_a Essentially, I want to read in a file and depending on location of 0, 1, 2, write to another file or create lists. The above passes without error warning but does nothing (semantic error?). Any Suggestions? Thanks in advance, Seafoid. -- View

Re: Line indexing in Python

2009-12-18 Thread seafoid
): a.write(line) elif line.endswith("0"): lists_a = line.strip().split() print lists_a elif line.startswith("0"): lists_b = line.strip().split() print lists_b Essentially, I wish to take input from a file and based on the location of z

Line indexing in Python

2009-12-18 Thread seafoid
y to refer to a line with the first character being a single letter that you know? Thanks in advance, Seafoid. -- View this message in context: http://old.nabble.com/Line-indexing-in-Python-tp26845253p26845253.html Sent from the Python - python-list mailing list archive at Nabble.com.

Re: Parsing file format to ensure file meets criteria

2009-12-17 Thread seafoid
Hi John, I considered that, but in an attempt to really figure out this supposedly simple language, I figure that I should try and solve this. I will check out the modules for future reference. Thanks, Seafoid :-) -- View this message in context: http://old.nabble.com/Parsing-file-format-to

Re: Parsing file format to ensure file meets criteria

2009-12-17 Thread seafoid
MRAB-2 Thank you for that! Funny how something so simple clarifies a whole lot! I will crack on now! Once again, Cheers and Thanks! -- View this message in context: http://old.nabble.com/Parsing-file-format-to-ensure-file-meets-criteria-tp26837682p26838085.html Sent from the Python - python

Parsing file format to ensure file meets criteria

2009-12-17 Thread seafoid
are irritatingly stupid, please feel free to advise that I r.t.f.m (read the f**king manual). However, thus far the manual has helped me little. Thanking you, Seafoid. -- View this message in context: http://old.nabble.com/Parsing-file-format-to-ensure-file-meets-criteria-tp26837682p2683