#python - Mon 26 Mar 2007 between 00:08 and 00:41

Jerublibraries mostly.
triplah_wanyone know how to get mysqldb to accept utf-8 queries?
Jerubtriplah_w: set the encoding and collation of the tables and the connection?
at one point it was utf-8+sweedish.
TFKyleI think if you set the default charset to utf-8 it'll work, havn't tried it though
Jerub(by default)
triplah_wwell when i use sqlobject i'm getting ascii cant encode blah blah
and when i use MySQLdb's dbapi i get latin-1 can encode blah
Jerubconvert from unicode to utf-8 first.
triplah_wi am
exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 73: ordinal not in range(128)
TFKyledoes it work with unicode strings?
triplah_wthe string s are unicode
i'm encoding them to utf-8
same problem both ways
TFKylewell, I meant unicode objects
i'll try
wait, my helper converts to unicode
then encodes in utf8
this is a show stopped at the moment :\
whitenoyceDoes python have an automated form filling out web bot?
Jerubtwill is nice for that kind of sausage.
triplah_wthis is annoying
so tempted to use sqlite for everything
sharmscan I read and write to the same file handle? Like read in the file, then rewrite its contents?
triplah_wclose it and reopen with mode "w"
sharmsok so opening it "rw" wont cut it
triplah_wthink about what you are asking :P
does it matter that much?
sharmsyeah one makes me write 3 more lines of code
triplah_wif you are worried about 3 lines of code you really shouldbe programming
you can seek the begining of the file if you really want to do it with the same filehandle
but i bet that will be more lines of code than reopening it
or about the same at least anway
sharmsI did that but it tells me it is a bad file descriptor, I am seeking to position 0
triplah_wcontents = open(f,'r').read()
two lines

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86