ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-tutor
python-tutor
Re: [Tutor] Mysql BLOB strangeness?
by Adam Cripps other posts by this author
Mar 25 2006 12:05AM messages near this date
Re: [Tutor] Mysql BLOB strangeness? | Re: [Tutor] Mysql BLOB strangeness?
On 3/19/06, Brian Gustin <brian@[...].com>  wrote:
>  OK so I guess you know what you need to do now :)  something like this
>  perhaaps :
> 
>  (modified your original code)
> 
>  reportlist = query(reportquery)
>  mystring = '<p>'
>  for row in reportlist:
>          id = row[0]
>          title = row[1]
>          content = row[2]
>          published = row[3]
>          mystring = mystring+id+"\t"+title+"\t"+content+"\t"+published+"</p>"
> 
>  print mystring
> 
>  should get you the data - you may want to force the values to str() type
>    just in case.. anyhow..  when you append an array to an array, you
>  have a multi-dimensional array, so when you iterate, you need to handle
>  two arrays, in essence.. what python is doing is just what it told you
>  to do - convert the multi dimensional list object into a string and
>  print it. :) , therefore, the output would be
>  array("listitem","listitem") basically :) you need to extract your list
>  elements and convert those to strings, then you can work with the whole
>  as a string :) otherwise,

This is similar to my original code - no? I cannot see anything that
dissimilar from my original code. I am attempting to extract the array
within the array through the use of
content[itr][1].

>  do print reportlist  (without the str() stuff) and you will print out
>  the entire list of data so you can see what you will be working with :)

Switching to a TEXT field in MySQL worked instantly. I think I
understand the idea behind the iteration (almost iteration inside
iteration). I did attempt it, but for some reason I couldn't get it to
work. Perhaps I'm not at that level yet.

Thanks guys.

Adam
--
http://www.monkeez.org
PGP key: 0x7111B833
_______________________________________________
Tutor maillist  -  Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor
Thread:
Adam Cripps
Brian Gustin
Adam Cripps
Brian Gustin
Adam Cripps
Kent Johnson
Brian Gustin
Adam Cripps
Kent Johnson
Adam Cripps
Liam Clarke
Brian Gustin
Adam Cripps
Hugo González Monteverde

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved