[Tutor] Checking if value exist in a '2D array'

2005-06-16 Thread Olli Rajala
sider list. Here's a little pseudo code if that helps. if list[[x][0]] == 'value': # where x can be anything > 0 print 'found' So, is there a similar method like list.count('value') that I use for 1D lists? Regards, -- Olli Rajala <>< Tampere,

Re: [Tutor] Postgresql+Python -tutorial?

2005-06-03 Thread Olli Rajala
, it's 'Debian loaded with current software'. ;) I mean, it's based on Debian, but the dev cycle is much faster than with Debian. Yours, -- Olli Rajala <>< Tampere, Finland http://www.students.tut.fi/~rajala37/ "In the

[Tutor] Database connections don't stay alive

2005-06-03 Thread Olli Rajala
ormation from very different sources and try to make it work... For example, this is from a manual I've used: 2.1.3.1 PQconnectdb Syntax: c = PQconnectdb(conninfo) Where conninfo is a string containing connection information. What the heck is 'conninfo', I mean, what's

[Tutor] Postgresql+Python -tutorial?

2005-06-03 Thread Olli Rajala
grams with MySQL+Python/Php/Java. So, if you have some good tutorials or something else info, I'd be glad to know! Oh, I can install additional modules, but it would be great if Ubuntu had them... Thanks! -- Olli Rajala <>< Tampere, Finland http://www.students.tut.fi/~rajala37/

[Tutor] CGI-script and multilingual output (HTTP_ACCEPT_LANGUAGE)

2005-05-21 Thread Olli Rajala
ht way to do it. I tried some Googling, but because don't know the proper terms, it wasn't very successful. So, any ideas would be very welcome! Yours, -- Olli Rajala <>< Tampere, Finland http://www.students.tut.fi/~rajala37/ &qu

Re: [Tutor] Removing lines in string-table

2005-05-17 Thread Olli Rajala
ecause the list contains x.jpg and x_thumb.jpg which have been collected by os.listdir(). At least I suppose that it would be like [x.jpg, x_thumb.jpg, y.jpg, y_thumb.jpg] or am I completely wrong? But thanks for good suggestions, I replaced my code with the list comprehension method and it works now. Thank

Re: [Tutor] Removing lines in string-table

2005-05-17 Thread Olli Rajala
thanks anyway. Yours, -- Olli Rajala <>< Tampere, Finland http://www.students.tut.fi/~rajala37/ "In theory, Theory and Practice should be the same. But in practice, they aren't." - Murphy's Proverbs ___ Tutor maillist

[Tutor] Removing lines in string-table

2005-05-17 Thread Olli Rajala
n fileNames: if line[-10:] == '_thumb.jpg': fileNames.remove(line) But I really doubt that it's not the best way to do this. So, any comments are really appreciated. Back to coding... -- Olli Rajala <>< Tampere, Finland http://www.students.tut.fi/~rajala37/ &qu

[Tutor] Save data 'over SSH'

2005-05-17 Thread Olli Rajala
the program is running on, if that matters. Oh, the program is a cgi-script running on Apache2 and it's running on my own computer so if I need to install some additional modules, it is possible. Thanks in advance! -- Olli Rajala <>< Tampere, Finland http://www.students.tut.fi/~raja

Re: [Tutor] Problems with encodings

2005-04-18 Thread Olli Rajala
sking, though. Yours, -- Olli Rajala <>< Tampere, Finland http://www.students.tut.fi/~rajala37/ "In theory, Theory and Practice should be the same. But in practice, they aren't." - Murphy's Proverbs ___ Tutor maillist - Tutor

Re: [Tutor] Problems with encodings

2005-04-18 Thread Olli Rajala
info, hope that this other problem could be solved as well. Yours sincerely, -- Olli Rajala <>< Tampere, Finland http://www.students.tut.fi/~rajala37/ "In theory, Theory and Practice should be the same. But in practice, they aren't." - Murphy's Proverbs _

[Tutor] Problems with encodings

2005-04-17 Thread Olli Rajala
else works well when speaking about this encoding thing. I really hope that someone would know a solution. I don't mind if I have to write only ASCII but I'm not the only user for that tool, so... Yours sincerely, -- Olli Rajala <>< Tampere, Finland http://www.students.tut

Re: [Tutor] CGI Video collection application File I/O troubles

2004-12-06 Thread Olli Rajala
ou anything to check that... :) Yours, -- Olli Rajala "In theory, Theory and Practice should be the same. But in practice, they aren't." - Murphy's Proverbs ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Address book sort of

2004-12-05 Thread Olli Rajala
g from Eric. S. Raymond if you want to know more. So, it may take much time to implement your read/write-functions but it's almost always at least as good as binary approach. Of course, as usual, YMMV and IMHO. :) -- Olli Rajala "In theory, Theory and Practice should be the same. B