[Tutor] Loop comparison

2010-04-15 Thread Ark
Hi everyone. A friend of mine suggested me to do the next experiment in python and Java. It's a simple program to sum all the numbers from 0 to 10. result = i = 0 while i < 10: result += i i += 1 print result The time for this calculations was huge. It took a long time t

Re: [Tutor] Creating class instances through iteration

2010-04-15 Thread Steven D'Aprano
On Fri, 16 Apr 2010 12:03:52 pm Tim Goddard wrote: > For example each row would look like [name, value1, value2, value3], > I planned on passing the three values as a tuple > > The code would simply be: > > for row in csvimport: > tuple = (row[1],row[2],row[3]) > instancename = Classname(t

[Tutor] Passing headers with httplib

2010-04-15 Thread Ray Parrish
Hello, I am trying to figure out how to send cookie data with an httplib request command. Here is what the doc says - request( method, url[, body[, headers]]) This will send a request to the server using the HTTP request method method and the selector url. If the body argument is pres

Re: [Tutor] Creating class instances through iteration

2010-04-15 Thread spir ☣
On Thu, 15 Apr 2010 21:03:52 -0500 Tim Goddard wrote: > I came across a situation where what I thought I wanted to do was to create > a class that was spawned from data in a .csv file. Where column 1 was the > name I wanted to use for each instance. I had it all figured out and > working except

[Tutor] Creating class instances through iteration

2010-04-15 Thread Tim Goddard
I came across a situation where what I thought I wanted to do was to create a class that was spawned from data in a .csv file. Where column 1 was the name I wanted to use for each instance. I had it all figured out and working except for how to write a statement where the left hand side could be

Re: [Tutor] "value" ~ "data" ~ "object"

2010-04-15 Thread Steven D'Aprano
On Thu, 15 Apr 2010 09:37:02 pm spir ☣ wrote: > Hello, > > I have been recently thinking at lexical distinctions around the > notion of data. (--> eg for a starting point > http://c2.com/cgi/wiki?WhatIsData) Not only but especially in Python. > I ended up with the following questions: Can one state

Re: [Tutor] [Python-ideas] "value" ~ "data" ~ "object"

2010-04-15 Thread Nick Coghlan
spir ☣ wrote: > What useful distinctions are or may be done, for instance in documentation? Python mainly considers: object identity (x is y, determined by id()) object value (x == y, determined by the implementations of relevant __eq__ methods) For many objects, their value degenerates to being

[Tutor] "value" ~ "data" ~ "object"

2010-04-15 Thread spir ☣
Hello, I have been recently thinking at lexical distinctions around the notion of data. (--> eg for a starting point http://c2.com/cgi/wiki?WhatIsData) Not only but especially in Python. I ended up with the following questions: Can one state "in Python value=data=object"? Can one state "in Pytho

Re: [Tutor] Re Problems with creating XML-documents

2010-04-15 Thread Lie Ryan
On 04/15/10 16:03, Karjer Jdfjdf wrote: > When I try to parse the outputfile it creates different errors such as: >* ExpatError: not well-formed (invalid token): That error message is telling you that you're not parsing an XML file, merely an XML-like file. > Basically it ususally has somethi

Re: [Tutor] Problems with creating XML-documents

2010-04-15 Thread Stefan Behnel
Hi, my main advice up-front: if you want good advice, give good details about the problem you face and enough background to let others understand what the real problem is and what your environmental constraints are. Karjer Jdfjdf, 15.04.2010 08:03: I know the theory of XML but have never us