Re: [Tutor] Any Tutor there ? Removing redundant par ameters in a models file having include files.

2010-03-02 Thread Steven D'Aprano
On Tue, 2 Mar 2010 11:25:44 am Andreas Kostyrka wrote: > Furthermore I do not think that most of the "core" community has a > problem with the alternate implementations, as they provide very > useful functions (it helps on the architecture side, because it > limits somewhat what can be done, it hel

[Tutor] parsing a "chunked" text file

2010-03-02 Thread Andrew Fithian
Hi tutor, I have a large text file that has chunks of data like this: headerA n1 line 1 line 2 ... line n1 headerB n2 line 1 line 2 ... line n2 Where each chunk is a header and the lines that follow it (up to the next header). A header has the number of lines in the chunk as its second field. I

Re: [Tutor] parsing a "chunked" text file

2010-03-02 Thread Christian Witts
Andrew Fithian wrote: Hi tutor, I have a large text file that has chunks of data like this: headerA n1 line 1 line 2 ... line n1 headerB n2 line 1 line 2 ... line n2 Where each chunk is a header and the lines that follow it (up to the next header). A header has the number of lines in the chun

Re: [Tutor] parsing a "chunked" text file

2010-03-02 Thread spir
On Mon, 1 Mar 2010 22:22:43 -0800 Andrew Fithian wrote: > Hi tutor, > > I have a large text file that has chunks of data like this: > > headerA n1 > line 1 > line 2 > ... > line n1 > headerB n2 > line 1 > line 2 > ... > line n2 > > Where each chunk is a header and the lines that follow it (up

[Tutor] correctly format and insert html block using python into mysql table

2010-03-02 Thread Norman Khine
hello, I have this code: >>> import re >>> import MySQLdb, csv, sys >>> conn = MySQLdb.connect (host = "localhost",user = "usr", passwd= "pass",db >>> = "databasename") >>> c = conn.cursor() >>> file = open('Data/asdsp-lao-farmers-et-batieng-products.html', 'r') >>> data = file.read() >>> get_rec

Re: [Tutor] parsing a "chunked" text file

2010-03-02 Thread Steven D'Aprano
On Tue, 2 Mar 2010 05:22:43 pm Andrew Fithian wrote: > Hi tutor, > > I have a large text file that has chunks of data like this: > > headerA n1 > line 1 > line 2 > ... > line n1 > headerB n2 > line 1 > line 2 > ... > line n2 > > Where each chunk is a header and the lines that follow it (up to the >

Re: [Tutor] Why is the max size so low in this mail list?

2010-03-02 Thread Lie Ryan
On 03/02/2010 04:13 AM, Wayne Watson wrote: > See Subject. 40K here, but other Python lists allow for larger (total) > sizes. I don't know, I've never realized it; that's an indication that the 40K limit is reasonable, at least to me. What did you get for posting >40K mails? Is your mail bounced?

Re: [Tutor] Any Tutor there ? Removing redundant parameters in a models file having include files.

2010-03-02 Thread Karim Liateni
Hello, Thanks a lot for this state of the art of the language, very instructive. I see now top of the iceberg ;o) Karim Steven D'Aprano wrote: On Tue, 2 Mar 2010 07:07:57 am Karim Liateni wrote: Thanks for this precision! I'm using standard python so this is ok! Why people use proprietar

[Tutor] getting diagonals from a matrix

2010-03-02 Thread David Eccles (gringer)
I've managed to drum up some code to obtain a list containing joined diagonal elements of a matrix (I'm making a word finder generator), but am wondering if there's any better way to do this: # setup so code snippet works properly sizeW = 4 sizeH = 3 puzzleLayout = ['spam'] * (sizeW * sizeH) # St