Re: How to add a current string into an already existing list

2013-11-06 Thread Mark Lawrence
On 06/11/2013 05:36, Dave Angel wrote: On Tue, 5 Nov 2013 09:45:15 -0600, Tim Chase wrote: You're assigning it to the bound function rather than calling the function. Use the "call" operator: data = infile.readlines() Thanks for spoiling the lesson. Nicks needs to learn how to debug 4 l

Re: How to add a current string into an already existing list

2013-11-05 Thread Dave Angel
On Tue, 5 Nov 2013 09:45:15 -0600, Tim Chase wrote: You're assigning it to the bound function rather than calling the function. Use the "call" operator: data = infile.readlines() Thanks for spoiling the lesson. Nicks needs to learn how to debug 4 line programs without someone giving him

Re: How to add a current string into an already existing list

2013-11-05 Thread Larry Hudson
On 11/05/2013 02:07 AM, Antoon Pardon wrote: And now you have depraved Nikos of the opportunity to really learn something. ... I know you meant "deprived", but "depraved Nikos" sounds like a good description to me. ;-) -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-

Re: How to add a current string into an already existing list

2013-11-05 Thread Denis McMahon
On Tue, 05 Nov 2013 11:34:53 +0200, Nick the Gr33k wrote: >>> data = cur.fetchall >>> for row in data: > I see, but because of the traceback not being to express it more easily > i was under the impression that data wasn't what i expected it to be. data wasn't what you expected it to be. The pr

Re: How to add a current string into an already existing list

2013-11-05 Thread Nick the Gr33k
Στις 5/11/2013 1:16 μμ, ο/η Dave Angel έγραψε: On Tue, 05 Nov 2013 12:33:49 +0200, Nick the Gr33k wrote: Στις 5/11/2013 12:20 μμ, ο/η Antoon Pardon έγραψε: > Did you read the documentation of fetchone? fetchone is like fetchall except from the fact that the former returned a row of data

Re: How to add a current string into an already existing list

2013-11-05 Thread Nick the Gr33k
Στις 5/11/2013 5:45 μμ, ο/η Tim Chase έγραψε: On 2013-11-05 17:39, Nick the Gr33k wrote: data = infile.readlines You're assigning it to the bound function rather than calling the function. Use the "call" operator: data = infile.readlines() -tkc -- infile=open("myfile.txt") data = i

Re: How to add a current string into an already existing list

2013-11-05 Thread Joel Goldstick
As I read this thread, the original question was how to stuff multiple values in a single sql column. Several people pointed out that the proper way to handle multiple values related to the original table is to use a second table or perhaps a many to many relationship with and intermediate join t

Re: How to add a current string into an already existing list

2013-11-05 Thread Tim Chase
On 2013-11-05 17:39, Nick the Gr33k wrote: > >>> data = infile.readlines You're assigning it to the bound function rather than calling the function. Use the "call" operator: data = infile.readlines() -tkc -- https://mail.python.org/mailman/listinfo/python-list

Re: How to add a current string into an already existing list

2013-11-05 Thread Nick the Gr33k
Στις 5/11/2013 3:15 μμ, ο/η Dave Angel έγραψε: On Tue, 05 Nov 2013 14:25:41 +0200, Nick the Gr33k wrote: i tried inserting a type function to notify me of the datatype of 'data' but that didnt help too. What did that print show ? In what way didn't it help? It said the type was Charles It

Re: How to add a current string into an already existing list

2013-11-05 Thread Dave Angel
On Tue, 05 Nov 2013 14:25:41 +0200, Nick the Gr33k wrote: i tried inserting a type function to notify me of the datatype of 'data' but that didnt help too. What did that print show ? In what way didn't it help? It said the type was Charles It didn'tprint anything It gave some other error It

Re: How to add a current string into an already existing list

2013-11-05 Thread Antoon Pardon
Op 05-11-13 13:25, Nick the Gr33k schreef: > > # fetch those columns that act as lists but are stored as strings > cur.execute('''SELECT refs, visits, downloads FROM visitors WHERE > counterID = %s and host = %s''', (cID, host) ) > data = cur.fetchone() > > print( type(data) ) > sys.exit(0

Re: How to add a current string into an already existing list

2013-11-05 Thread Nick the Gr33k
Στις 5/11/2013 1:49 μμ, ο/η Steven D'Aprano έγραψε: On Tue, 05 Nov 2013 12:33:49 +0200, Nick the Gr33k wrote: Στις 5/11/2013 12:20 μμ, ο/η Antoon Pardon έγραψε: Did you read the documentation of fetchone? fetchone is like fetchall except from the fact that the former returned a row of dat

Re: How to add a current string into an already existing list

2013-11-05 Thread Steven D'Aprano
On Tue, 05 Nov 2013 12:33:49 +0200, Nick the Gr33k wrote: > Στις 5/11/2013 12:20 μμ, ο/η Antoon Pardon έγραψε: > >> Did you read the documentation of fetchone? > > > > fetchone is like fetchall except from the fact that the former returned > a row of data while the latter returned a list of ro

Re: How to add a current string into an already existing list

2013-11-05 Thread Dave Angel
On Tue, 05 Nov 2013 12:33:49 +0200, Nick the Gr33k wrote: Στις 5/11/2013 12:20 μμ, ο/η Antoon Pardon έγραψε: > Did you read the documentation of fetchone? fetchone is like fetchall except from the fact that the former returned a row of data while the latter returned a list of rows of dat

Re: How to add a current string into an already existing list

2013-11-05 Thread Dave Angel
On Tue, 05 Nov 2013 11:34:53 +0200, Nick the Gr33k wrote: I see, but because of the traceback not being to express it more easily i was under the impression that data wasn't what i expected it to be. Exactly. So why didn't you act on that impression? Your error message told you that data wa

Re: How to add a current string into an already existing list

2013-11-05 Thread Antoon Pardon
Op 05-11-13 11:33, Nick the Gr33k schreef: > Στις 5/11/2013 12:20 μμ, ο/η Antoon Pardon έγραψε: > >> Did you read the documentation of fetchone? > > > > fetchone is like fetchall except from the fact that the former returned > a row of data while the latter returned a list of rows of data. Fro

Re: How to add a current string into an already existing list

2013-11-05 Thread Nick the Gr33k
Στις 5/11/2013 12:20 μμ, ο/η Antoon Pardon έγραψε: Did you read the documentation of fetchone? fetchone is like fetchall except from the fact that the former returned a row of data while the latter returned a list of rows of data. I dont know why it copmains about: TypeError: 'NoneType' o

Re: How to add a current string into an already existing list

2013-11-05 Thread Chris Angelico
On Tue, Nov 5, 2013 at 8:10 PM, M.F. wrote: > That is what the stack trace and Christ tried to inform you. Let's go with "and Chris tried"... no need to promote me to deity status :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: How to add a current string into an already existing list

2013-11-05 Thread Antoon Pardon
Op 05-11-13 10:56, Nick the Gr33k schreef: > Στις 5/11/2013 11:34 πμ, ο/η Nick the Gr33k έγραψε: >> Στις 5/11/2013 11:10 πμ, ο/η M.F. έγραψε: >>> On 11/05/2013 04:54 PM, Nick the Gr33k wrote: === data = cur.fetchall >>> data = cur.fetchall() >>> That is what the stac

Re: How to add a current string into an already existing list

2013-11-05 Thread Antoon Pardon
Op 05-11-13 10:10, M.F. schreef: > On 11/05/2013 04:54 PM, Nick the Gr33k wrote: >> >> >> === >> data = cur.fetchall > data = cur.fetchall() > That is what the stack trace and Christ tried to inform you. And now you have depraved Nikos of the opportunity to really learn something. I'm

Re: How to add a current string into an already existing list

2013-11-05 Thread Nick the Gr33k
Στις 5/11/2013 11:34 πμ, ο/η Nick the Gr33k έγραψε: Στις 5/11/2013 11:10 πμ, ο/η M.F. έγραψε: On 11/05/2013 04:54 PM, Nick the Gr33k wrote: === data = cur.fetchall data = cur.fetchall() That is what the stack trace and Christ tried to inform you. for row in data: ===

Re: How to add a current string into an already existing list

2013-11-05 Thread Nick the Gr33k
Στις 5/11/2013 11:10 πμ, ο/η M.F. έγραψε: On 11/05/2013 04:54 PM, Nick the Gr33k wrote: === data = cur.fetchall data = cur.fetchall() That is what the stack trace and Christ tried to inform you. for row in data: === The only thing i can understand by looking the abov

Re: How to add a current string into an already existing list

2013-11-05 Thread M.F.
On 11/05/2013 04:54 PM, Nick the Gr33k wrote: === data = cur.fetchall data = cur.fetchall() That is what the stack trace and Christ tried to inform you. for row in data: === The only thing i can understand by looking the above 2 lines is this: 'for' fails to iterate

Re: How to add a current string into an already existing list

2013-11-05 Thread Nick the Gr33k
Στις 5/11/2013 10:21 πμ, ο/η Chris Angelico έγραψε: On Tue, Nov 5, 2013 at 7:07 PM, Nick the Gr33k wrote: How is ti possible for data to be none iterable? Do you know how to call a method in Python? If not, go back to the beginning of the tutorial and start reading. If so, look through your c

Re: How to add a current string into an already existing list

2013-11-05 Thread Nick the Gr33k
Στις 5/11/2013 10:21 πμ, ο/η Chris Angelico έγραψε: On Tue, Nov 5, 2013 at 7:07 PM, Nick the Gr33k wrote: How is ti possible for data to be none iterable? Do you know how to call a method in Python? If not, go back to the beginning of the tutorial and start reading. If so, look through your c

Re: How to add a current string into an already existing list

2013-11-05 Thread Antoon Pardon
Op 05-11-13 09:21, Chris Angelico schreef: > On Tue, Nov 5, 2013 at 7:07 PM, Nick the Gr33k wrote: >> How is ti possible for data to be none iterable? > > Do you know how to call a method in Python? If not, go back to the > beginning of the tutorial and start reading. If so, look through your > c

Re: How to add a current string into an already existing list

2013-11-05 Thread Chris Angelico
On Tue, Nov 5, 2013 at 7:07 PM, Nick the Gr33k wrote: > How is ti possible for data to be none iterable? Do you know how to call a method in Python? If not, go back to the beginning of the tutorial and start reading. If so, look through your code and see where you have a 'method' object that you

Re: How to add a current string into an already existing list

2013-11-05 Thread Nick the Gr33k
Στις 5/11/2013 8:54 πμ, ο/η Nick the Gr33k έγραψε: Στις 5/11/2013 12:46 πμ, ο/η Denis McMahon έγραψε: On Mon, 04 Nov 2013 19:03:58 +0200, Nick the Gr33k wrote: There is no built in support in the python / mysql system for puttinga list straight into a database, because mysql does not have"col

Re: How to add a current string into an already existing list

2013-11-04 Thread Nick the Gr33k
Στις 5/11/2013 12:46 πμ, ο/η Denis McMahon έγραψε: On Mon, 04 Nov 2013 19:03:58 +0200, Nick the Gr33k wrote: There is no built in support in the python / mysql system for puttinga list straight into a database, because mysql does not have"collection" record type. Does postgresql has this 'co

Re: How to add a current string into an already existing list

2013-11-04 Thread Denis McMahon
On Mon, 04 Nov 2013 19:03:58 +0200, Nick the Gr33k wrote: > Please since this column you mentioned is able to store a Python's list > datatype could you tell me what needs alternation in: We've already told you, there is NO mysql datatype that can store a python list directly. There are ways of

Re: How to add a current string into an already existing list

2013-11-04 Thread Nick the Gr33k
Στις 3/11/2013 2:16 μμ, ο/η Roy Smith έγραψε: In article , Gregory Ewing wrote: Nick the Gr33k wrote: I just want a mysql column type that can be eligible to store an array of elements, a list that is, no need for having a seperate extra table for that if we can have a column that can store

Re: How to add a current string into an already existing list

2013-11-03 Thread Chris Angelico
On Sun, Nov 3, 2013 at 11:16 PM, Roy Smith wrote: > The limitation, of course, is that the data is opaque as far as the > database goes; you can't do queries against it. But, if all you need to > do is store the list and be able to retrieve it, it's a perfectly > reasonable thing to do, and a lot

Re: How to add a current string into an already existing list

2013-11-03 Thread Roy Smith
In article , Gregory Ewing wrote: > Nick the Gr33k wrote: > > I just want a mysql column type that can be eligible to store an array > > of elements, a list that is, no need for having a seperate extra table > > for that if we can have a column that can store a list of values. > > Relational

Re: How to add a current string into an already existing list

2013-11-03 Thread Antoon Pardon
Op 03-11-13 07:06, Gregory Ewing schreef: > Nick the Gr33k wrote: >> I just want a mysql column type that can be eligible to store an array of >> elements, a list that is, no need for having a seperate extra table for that >> if we can have a column that can store a list of values. > > Relationa

Re: How to add a current string into an already existing list

2013-11-02 Thread Gregory Ewing
Nick the Gr33k wrote: I just want a mysql column type that can be eligible to store an array of elements, a list that is, no need for having a seperate extra table for that if we can have a column that can store a list of values. Relational database systems typically don't provide any such typ

Re: How to add a current string into an already existing list

2013-11-02 Thread Chris Angelico
On Sun, Nov 3, 2013 at 9:00 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> On Sun, Nov 3, 2013 at 5:30 AM, Jussi Piitulainen >> wrote: >> > Suppose a database allowed structured values like lists of strings, >> > lists of numbers, or even lists of such lists and more. Then it

Re: How to add a current string into an already existing list

2013-11-02 Thread Roy Smith
In article , Chris Angelico wrote: > On Sun, Nov 3, 2013 at 5:30 AM, Jussi Piitulainen > wrote: > > Suppose a database allowed structured values like lists of strings, > > lists of numbers, or even lists of such lists and more. Then it would > > actually be a Python issue how best to support th

Re: How to add a current string into an already existing list

2013-11-02 Thread Chris Angelico
On Sun, Nov 3, 2013 at 5:30 AM, Jussi Piitulainen wrote: > Suppose a database allowed structured values like lists of strings, > lists of numbers, or even lists of such lists and more. Then it would > actually be a Python issue how best to support that database. PostgreSQL supports some higher-le

Re: How to add a current string into an already existing list

2013-11-02 Thread Walter Hurry
On Sat, 02 Nov 2013 10:40:58 -0700, rusi wrote: > That Codd... > Should have studied some computer science > > [Ive a vague feeling I am repeating myself...] ROFL. Get thee into FNF! -- https://mail.python.org/mailman/listinfo/python-list

Re: How to add a current string into an already existing list

2013-11-02 Thread Jussi Piitulainen
rusi writes: > On Saturday, November 2, 2013 10:13:06 PM UTC+5:30, Denis McMahon wrote: > > On Sat, 02 Nov 2013 18:25:31 +0200, Nick the Gr33k wrote: > > > > I just want a mysql column type that can be eligible to store an > > > array of elements, a list that is, no need for having a seperate > >

Re: How to add a current string into an already existing list

2013-11-02 Thread Mark Lawrence
On 02/11/2013 17:40, rusi wrote: On Saturday, November 2, 2013 10:13:06 PM UTC+5:30, Denis McMahon wrote: On Sat, 02 Nov 2013 18:25:31 +0200, Nick the Gr33k wrote: I just want a mysql column type that can be eligible to store an array of elements, a list that is, no need for having a seperate

Re: How to add a current string into an already existing list

2013-11-02 Thread rusi
On Saturday, November 2, 2013 10:13:06 PM UTC+5:30, Denis McMahon wrote: > On Sat, 02 Nov 2013 18:25:31 +0200, Nick the Gr33k wrote: > > I just want a mysql column type that can be eligible to store an array > > of elements, a list that is, no need for having a seperate extra table > > for that if

Re: How to add a current string into an already existing list

2013-11-02 Thread Denis McMahon
On Sat, 02 Nov 2013 18:25:31 +0200, Nick the Gr33k wrote: > I just want a mysql column type that can be eligible to store an array > of elements, a list that is, no need for having a seperate extra table > for that if we can have a column that can store a list of values. You'd better take that up

Re: How to add a current string into an already existing list

2013-11-02 Thread Nick the Gr33k
Στις 2/11/2013 3:03 μμ, ο/η Andreas Perstinger έγραψε: On 02.11.2013 12:58, Nick the Gr33k wrote: Trying to add the current filename into the existent 'downloads' column Somehow i don't think i just use the plus sign into an existing column. We don't try to add numbers here but add an extra stri

Re: How to add a current string into an already existing list

2013-11-02 Thread Andreas Perstinger
On 02.11.2013 12:58, Nick the Gr33k wrote: Trying to add the current filename into the existent 'downloads' column Somehow i don't think i just use the plus sign into an existing column. We don't try to add numbers here but add an extra string to an already existing array of strings(list). [SNI

How to add a current string into an already existing list

2013-11-02 Thread Nick the Gr33k
Trying to add the current filename into the existent 'downloads' column Somehow i don't think i just use the plus sign into an existing column. We don't try to add numbers here but add an extra string to an already existing array of strings(list). ==