Re: OT: e-mail reply to old/archived message

2013-06-12 Thread nagia . retsina
Τη Τετάρτη, 12 Ιουνίου 2013 9:36:41 π.μ. UTC+3, ο χρήστης Phil Connell έγραψε:
> On 12 Jun 2013 02:20,  wrote:
> 
> >
> 
> > How can i be able to answer you guys posts by my mail client?
> 
> Don't delete mails that you might want to reply to. 
> 
> If you do anything else, you're just making it difficult for yourself.
> 
> Cheers, 
> 
> Phil
> 
> > --
> 
> > http://mail.python.org/mailman/listinfo/python-list

i installed pan for windows just now, lets hpe it will be a workign alternative.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Receing a form variable as a list instead of as a string

2013-06-11 Thread nagia . retsina
if page or form.getvalue('show') == 'log': 
# it is a python script 
page = page.replace( '/home/nikos/public_html/cgi-bin', '' ) 
elif page or form.getvalue('show') == 'stats': 
page = page.replace( '/home/nikos/public_html/cgi-bin', '' ) 


in the first if option page works a string and replace happens , while in the 
second it behaves liek a list and the error i mentioned is being produced.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A certainl part of an if() structure never gets executed.

2013-06-11 Thread nagia . retsina
Τη Τετάρτη, 12 Ιουνίου 2013 1:43:21 π.μ. UTC+3, ο χρήστης MRAB έγραψε:
> On 11/06/2013 21:20, Νικόλαος Κούρας wrote:
> 
> > [code]
> 
> > if not re.search( '=', name ) and not re.search( '=', month ) 
> > and not re.search( '=', year ):
> 
> > cur.execute( '''SELECT * FROM works WHERE clientsID = 
> > (SELECT id FROM clients WHERE name = %s) and MONTH(lastvisit) = %s and 
> > YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (name, month, year) )
> 
> > elif not re.search( '=', month ) and not re.search( '=', year ):
> 
> > cur.execute( '''SELECT * FROM works WHERE 
> > MONTH(lastvisit) = %s and YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', 
> > (month, year) )
> 
> > elif not re.search( '=', year ):
> 
> > cur.execute( '''SELECT * FROM works WHERE 
> > YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', year )
> 
> > else:
> 
> > print('''Πώς να γίνει αναζήτηση αφού δεν επέλεξες 
> > ούτε πελάτη ούτε μήνα ή τουλάχιστον το έτος?''')
> 
> > print( ''' > content="5;/cgi-bin/pelatologio.py">''' )
> 
> > sys.exit(0)
> 
> >
> 
> > data = cur.fetchall()
> 
> > 
> 
> > hits = money = 0
> 
> > 
> 
> > for row in data:
> 
> > hits += 1
> 
> > money = money + row[2]
> 
> >
> 
> > ..
> 
> > ..
> 
> > selects based on either name, month, year or all of them
> 
> > [/code]
> 
> >
> 
> >
> 
> > The above if structure works correctly *only* if the user sumbits by form:
> 
> >
> 
> > name, month, year
> 
> > or
> 
> > month, year
> 
> >
> 
> > If, he just enter a year in the form and sumbit then, i get no error, but 
> > no results displayed back.
> 
> >
> 
> > Any ideas as to why this might happen?
> 
> >
> 
> What are the values of 'name', 'month' and 'year' in each of the cases?
> 
> Printing out ascii(name), ascii(month) and ascii(year), will be helpful.
> 
> 
> 
> Then try stepping through those lines in your head.

i hav epribted all values of those variables and they are all correct.
i just dont see why ti fails to enter the specific if case.

is there a shorter and more clear way to write this?
i didnt understood what Rick trie to told me.

can you help me write it more easily?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: e-mail reply to old/archived message

2013-06-11 Thread nagia . retsina
How can i be able to answer you guys posts by my mail client?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-10 Thread nagia . retsina
Τη Κυριακή, 9 Ιουνίου 2013 3:31:44 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε:

> py> c = 'α'
> py> ord(c)
> 945

The number 945 is the characters 'α' ordinal value in the unicode charset 
correct?

The command in the python interactive session to show me how many bytes
this character will take upon encoding to utf-8 is:

>>> s = 'α'
>>> s.encode('utf-8')
b'\xce\xb1'

I see that the encoding of this char takes 2 bytes. But why two exactly?
How do i calculate how many bits are needed to store this char into bytes?


Trying to to the same here but it gave me no bytes back.

>>> s = 'a'
>>> s.encode('utf-8')
b'a'


>py> c.encode('utf-8')
> b'\xce\xb1'

2 bytes here. why 2?

> py> c.encode('utf-16be')
> b'\x03\xb1'

2 byets here also. but why 3 different bytes? the ordinal value of char 'a' is 
the same in unicode. the encodign system just takes the ordinal value end 
encode, but sinc eit uses 2 bytes should these 2 bytes be the same?

> py> c.encode('utf-32be')
> b'\x00\x00\x03\xb1

every char here takes exactly 4 bytes to be stored. okey.

> py> c.encode('iso-8859-7')
> b'\xe1'

And also does '\x' means that the value is being respresented in hex way?
and when i bin(6) i see '0b101'

I should expect to see 8 bits of 1s and 0's. what the 'b' is tryign to say?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread nagia . retsina
Τη Κυριακή, 9 Ιουνίου 2013 3:36:51 μ.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε:

> > printing a greek Unicode string in the error with ASCII 
> > as the output encoding (default when not a tty IIRC).

> An interesting thought. How would we test that?

Please elaborare this for me. I ditn undertood what you are trying to say, your 
assumption of why still ima getting decode issues.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread nagia . retsina
Thanks Stevn, i ll read them in a bit. When i read them can you perhaps tell me 
whats wrong and ima still getting decode issues?

[CODE]
# 
=
# If user downloaded a file, thank the user !!!
# 
=
if filename:
#update file counter if cookie does not exist
if not nikos:
cur.execute('''UPDATE files SET hits = hits + 1, host = %s, 
lastvisit = %s WHERE url = %s''', (host, lastvisit, filename) )

print('''Το αρχείο  %s κατεβαίνει!''' % filename )
print('')
print('''Και τώρα Tetris μέχρι να 
ολοκληρωθεί :-)''' )
print('''http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0";
 width="450" height="300"">http://www.fugly.com/f/1e6d8cd7b905f4e1bf72"; />http://www.fugly.com/f/1e6d8cd7b905f4e1bf72"; AllowScriptAccess="always" 
menu="false" quality="high" width="450" height="300" name="FuglyGame" 
align="middle" type="application/x-shockwave-flash" 
pluginspage="http://www.macromedia.com/go/getflashplayer"; />''')

print( '' % 
filename )
sys.exit(0)


# 
=
# Display download button for each file and download it on click
# 
=
print('''
 
 
''')


#
# Collect directory and its filenames as bytes
path = b'/home/nikos/public_html/data/apps/'
files = os.listdir( path )

for filename in files:
# Compute 'path/to/filename'
filepath_bytes = path + filename
for encoding in ('utf-8', 'iso-8859-7', 'latin-1'):
try: 
filepath = filepath_bytes.decode( encoding )
except UnicodeDecodeError:
continue

# Rename to something valid in UTF-8 
if encoding != 'utf-8': 
os.rename( filepath_bytes, filepath.encode('utf-8') )

assert os.path.exists( filepath )
break 
else: 
# This only runs if we never reached the break
raise ValueError( 'unable to clean filename %r' % 
filepath_bytes ) 


#
# Collect filenames of the path dir as strings
filenames = os.listdir( '/home/nikos/public_html/data/apps/' )

# Load'em
for filename in filenames:
try:
# Check the presence of a file against the database and insert 
if it doesn't exist
cur.execute('''SELECT url FROM files WHERE url = %s''', 
(filename,) )
data = cur.fetchone()

if not data:
# First time for file; primary key is automatic, hit is 
defaulted
print( "iam here", filename + '\n' )
cur.execute('''INSERT INTO files (url, host, lastvisit) 
VALUES (%s, %s, %s)''', (filename, host, lastvisit) )
except pymysql.ProgrammingError as e:
print( repr(e) )


#
# Collect filenames of the path dir as strings
filenames = os.listdir( '/home/nikos/public_html/data/apps/' )
filepaths = set()

# Build a set of 'path/to/filename' based on the objects of path dir
for filename in filenames:
filepaths.add( filename )

# Delete spurious 
cur.execute('''SELECT url FROM files''')
data = cur.fetchall()

# Check database's filenames against path's filenames
for rec in data:
if rec not in filepaths:
cur.execute('''DELETE FROM files WHERE url = %s''', rec )
[/CODE] 

When trying to run it is still erroting out:

[CODE]
[Sun Jun 09 09:37:51 2013] [error] [client 79.103.41.173] Original exception 
was:, referer: http://superhost.gr/
[Sun Jun 09 09:37:51 2013] [error] [client 79.103.41.173] Traceback (most 
recent call last):, referer: http://superhost.gr/
[Sun Jun 09 09:37:51 2013] [error] [client 79.103.41.173]   File 
"/home/nikos/public_html/cgi-bin/files.py", line 83, in , referer: 
http://superhost.gr/
[Sun Jun 09 09:37:51 2013] [error] [client 79.103.41.173] assert 
os.path.exists( filepath ), referer: http://superhost.gr/
[Sun Jun 09 09:37:51 2013] [error] [client 79.103.41.173]   File 
"/usr/local/lib/python3.3/genericpath.py", line 18, in exists, referer: 
http://superhost.gr/
[Sun Jun 09 09:37:51 2013] [error] [client 79.103.41.173] os.stat(path), 
referer: http://superhost.gr/
[Sun Jun 09 09:37:51 2013] [error] [client 79.103.41.173] UnicodeEncodeError: 
'ascii' codec can't encode character

Re: Errin when executing a cgi script that sets a cookie in the browser

2013-06-08 Thread nagia . retsina
Trying 

yum install dos2unix

and 

root@nikos [/home/nikos/www/cgi-bin]# dos2unix koukos.py
dos2unix: converting file koukos.py to UNIX format ...


Then browsed to the page again in Chrome it worked as expected :-)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-08 Thread nagia . retsina
Τη Σάββατο, 8 Ιουνίου 2013 9:47:53 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:

> Fortunately, Python lets us hide away pretty much all those details, 
> just as it lets us hide away the details of what makes up a list, a
> dictionary, or an integer. You can safely assume that the string "foo"
> is a string of three characters, which you can work with as
> characters. The chr() and ord() functions let you switch between
> characters and numbers, and str.encode() and bytes.decode() let you
> switch between characters and byte sequences. Once you get your head
> around the differences between those three, it all works fairly
> neatly.

I'm trying too!

So,

chr('A') would give me the mapping of this char, the number 65 while
ord(65) would output the char 'A' likewise.

>and str.encode() and bytes.decode() let you switch between characters and byte 
>>sequences. Once

What would happen if we we try to re-encode bytes on the disk?
like trying:

s = "νίκος"
utf8_bytes = s.encode('utf-8')
greek_bytes = utf_bytes.encode('iso-8869-7')

Can we re-encode twice or as many times we want and then decode back 
respectively lke?

utf8_bytes = greek_bytes.decode('iso-8859-7')
s = utf8_bytes.decoce('utf-8')

Is somethign like that totally crazy?

And also is there a deiffrence between "encoding" and "compressing" ?

Isnt the latter useing some form of encoding to take a string or bytes to make 
hold less space on disk?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-06 Thread nagia . retsina
Τη Παρασκευή, 7 Ιουνίου 2013 4:25:40 π.μ. UTC+3, ο χρήστης Steven D'Aprano 
έγραψε:

> MRAB tells you to work with the bytes, because the filenames' bytes are 
> invalid decoded as UTF-8. If you fix the file names by renaming using a 
> terminal set to UTF-8, then they will be valid and you can forget about  
> working with bytes.

Yes, but but 'putty' seems to always forget when i tell it to use utf8 for 
displaying and always picks up the Win8's default charset and it doesnt have a 
save options dialog. I cant always remember to switch to utf8 charset or 
renaming all the time from termnal so many greek filenames.

> Working with bytes is only for when the file names are turned to garbage.  
> Your file names (some of them) are turned to garbage. Fix them, and then 
> use file names as strings.

Can't '~/data/apps/' is filled every day with more and more files which are 
uploaded via FileZilla client, which i think it behaves pretty much like putty, 
uploading filenames as greek-iso bytes.

So that garbage will happen every day due to 'Putty' & 'FileZilla' clients.

So files.py before doing their stuff must do the automatic conversions from 
greek bytes to utf-8 bytes.

Here is what i have up until now.

=
 # Collect filenames of the path dir as bytes
filename_bytes = os.listdir( b'/home/nikos/public_html/data/apps/' )

# Iterate over all filenames in the path dir
for filename in filenames_bytes:
# Compute 'path/to/filename' in bytes
filepath_bytes = b'/home/nikos/public_html/data/apps/' + b'filename'
try:
filepath = filepath_bytes.decode('utf-8')
except UnicodeDecodeError:
try:
filepath = filepath_bytes.decode('iso-8859-7')

# Rename filename from greek bytes => utf-8 bytes
os.rename( filepath_bytes filepath.encode('utf-8') )
except UnicodeDecodeError:
print "I give up! This filename is unreadable!"
=

This is the best i can come up with, but after:

ni...@superhost.gr [~/www/cgi-bin]# python files.py
  File "files.py", line 75
os.rename( filepath_bytes filepath.encode('utf-8') )
 ^
SyntaxError: invalid syntax
ni...@superhost.gr [~/www/cgi-bin]#



I am seeign the caret pointing at filepath but i cant follow what it tries to 
tell me. No parenthesis missed or added this time due to speed and tireness.

This rename statement tries to convert the greek byted filepath to utf-8 byted 
filepath.

I can't see whay this is wrong though.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-03 Thread nagia . retsina
Τη Τρίτη, 4 Ιουνίου 2013 1:46:53 π.μ. UTC+3, ο χρήστης Steven D'Aprano έγραψε:

> Not so -- it actually shows correctly, provided you use the right 
> encoding. Tell your browser to view the page as UTF-8, and the file name 
> is displayed correctly.

I can't believe Chrome whcih by default uses utf8 chosed iso-8859-1 to presnt 
the filenames.
You were right Steven, when i explicitly told him to presnt page sin utf8 it 
then started to show tha filesname correctly.
 
> I now tentatively believe that the file names are correct, using the UTF-8  
> encoding. But you can help confirm this:

> * What operating system are you using? If Linux, what distro and version?
> * What is the output of the locale command?

First of all thank you very much for being so cooperative, i appreciate it.

Here is some of my system insight you wanted to see.


ni...@superhost.gr [~]# uname -a
Linux nikos.superhost.gr 2.6.32-042stab075.2 #1 SMP Tue May 14 20:38:14 MSK 
2013 x86_64 x86_64 x86_64 GNU/Linux

ni...@superhost.gr [~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
ni...@superhost.gr [~]#

I'am using CentOS v6.4 becaue it is the only linux OS that supports cPanel 
which my clients need to administer their websites.

Hese is also how the terminal presents my filenames.

ni...@superhost.gr [~]# ls -l www/data/apps/
total 368548
drwxr-xr-x 2 nikos nikos 4096 Jun  3 12:07 ./
drwxr-xr-x 6 nikos nikos 4096 May 26 21:13 ../
-rwxr-xr-x 1 nikos nikos 13157283 Mar 17 12:57 100\ Mythoi\ tou\ Aiswpou.pdf*
-rwxr-xr-x 1 nikos nikos 29524686 Mar 11 18:17 Anekdotologio.exe*
-rw-r--r-- 1 nikos nikos 42413964 Jun  2 20:29 Battleship.exe
-rwxr-xr-x 1 nikos nikos 66896732 Mar 17 13:13 Kosmas\ o\ Aitwlos\ -\ 
Profiteies  
  .pdf*
-rw-r--r-- 1 nikos nikos 51819750 Jun  2 20:04 Luxor\ Evolved.exe
-rw-r--r-- 1 nikos nikos 60571648 Jun  2 14:59 Monopoly.exe
-rwxr-xr-x 1 nikos nikos  1788164 Mar 14 11:31 Online\ Movie\ Player.zip*
-rw-r--r-- 1 nikos nikos  5277287 Jun  1 18:35 O\ Nomos\ tou\ Merfy\ v1-2-3.zip
-rwxr-xr-x 1 nikos nikos 16383001 Jun 22  2010 Orthodoxo\ Imerologio.exe*
-rw-r--r-- 1 nikos nikos  6084806 Jun  1 18:22 Pac-Man.exe
-rw-r--r-- 1 nikos nikos 25476584 Jun  2 19:50 Scrabble\ 2013.exe
-rw-r--r-- 1 nikos nikos   236032 Jun  2 19:31 Skepsou\ enan\ arithmo!.exe
-rwxr-xr-x 1 nikos nikos 49141166 Mar 17 12:48 To\ 1o\ mou\ vivlio\ gia\ to\ 
ska 
   ki.pdf*
-rwxr-xr-x 1 nikos nikos  3298310 Mar 17 12:45 Vivlos\ gia\ Atheofovous.pdf*
-rw-r--r-- 1 nikos nikos  1764864 May 29 21:50 V-Radio\ v2.4.msi
-rw-r--r-- 1 nikos nikos  3511233 Jun  3 12:07 ΞΟ
ΟΞ�\ Ο
  ΞΏΟ.mp3
ni...@superhost.gr [~]#

Its wird, because as locale showed from above terminal is set to 'utf-8' but 
the greek filename cannot be viewed properly.
I must say though, that i have renamed it from my Windows 8 system and then 
uploaded via FileZilla to my remote webhost server. Maybe windows 8 is causing 
this?

I'll try renaming it via terminal too.
f you want to see soemhtign  else please ask me to show you Steven.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Too many python installations. Should i remove them all and install the latest?

2013-06-03 Thread nagia . retsina
Τη Δευτέρα, 3 Ιουνίου 2013 5:35:46 μ.μ. UTC+3, ο χρήστης Walter Hurry έγραψε:
> On Sun, 02 Jun 2013 14:41:45 +1000, Chris Angelico wrote:
> 
> 
> 
> > Nikos just
> 
> > needs to learn the skill of figuring out where his problems really are.
> 
> > 
> 
> Between the keyboard and the chair, obv.

Maybe you should tell us how you find out yours.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-03 Thread nagia . retsina
Τη Δευτέρα, 3 Ιουνίου 2013 3:54:30 μ.μ. UTC+3, ο χρήστης rusi έγραψε:

> Is that how you renamed your file?
> In any case thats what I see!
> [Dont whether to say: Its greek to me or its not greek to me!!]

Now! that weird again.
I rename sit using proper Greek letters but as it appears to you it also 
appears to me via Chrome.

Also this is how it looks like via linux cmd listing:

ni...@superhost.gr [~/www/cgi-bin]# ls -l ../data/apps/
total 368548
drwxr-xr-x 2 nikos nikos 4096 Jun  3 12:07 ./
drwxr-xr-x 6 nikos nikos 4096 May 26 21:13 ../
-rwxr-xr-x 1 nikos nikos 13157283 Mar 17 12:57 100\ Mythoi\ tou\ Aiswpou.pdf*
-rwxr-xr-x 1 nikos nikos 29524686 Mar 11 18:17 Anekdotologio.exe*
-rw-r--r-- 1 nikos nikos 42413964 Jun  2 20:29 Battleship.exe
-rwxr-xr-x 1 nikos nikos 66896732 Mar 17 13:13 Kosmas\ o\ Aitwlos\ -\ 
Profiteies  
  .pdf*
-rw-r--r-- 1 nikos nikos 51819750 Jun  2 20:04 Luxor\ Evolved.exe
-rw-r--r-- 1 nikos nikos 60571648 Jun  2 14:59 Monopoly.exe
-rwxr-xr-x 1 nikos nikos  1788164 Mar 14 11:31 Online\ Movie\ Player.zip*
-rw-r--r-- 1 nikos nikos  5277287 Jun  1 18:35 O\ Nomos\ tou\ Merfy\ v1-2-3.zip
-rwxr-xr-x 1 nikos nikos 16383001 Jun 22  2010 Orthodoxo\ Imerologio.exe*
-rw-r--r-- 1 nikos nikos  6084806 Jun  1 18:22 Pac-Man.exe
-rw-r--r-- 1 nikos nikos 25476584 Jun  2 19:50 Scrabble\ 2013.exe
-rw-r--r-- 1 nikos nikos   236032 Jun  2 19:31 Skepsou\ enan\ arithmo!.exe
-rwxr-xr-x 1 nikos nikos 49141166 Mar 17 12:48 To\ 1o\ mou\ vivlio\ gia\ to\ 
ska 
   ki.pdf*
-rwxr-xr-x 1 nikos nikos  3298310 Mar 17 12:45 Vivlos\ gia\ Atheofovous.pdf*
-rw-r--r-- 1 nikos nikos  1764864 May 29 21:50 V-Radio\ v2.4.msi
-rw-r--r-- 1 nikos nikos  3511233 Jun  3 12:07 ΞΟ
ΟΞ�\ Ο
  ΞΏΟ.mp3
ni...@superhost.gr [~/www/cgi-bin]# 

Why doesnt the name of the ?

file doesnt appear in proper Greek letter neither from cmd nor for Chrome too?
It's no wonder files.py cant decode it in 'utf-8'

How can i make the filanems appear properly or at least decode from byte 
strea,m to utf-8 properly so they can be opened via the python script without 
error?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-02 Thread nagia . retsina
Τη Κυριακή, 2 Ιουνίου 2013 10:44:05 μ.μ. UTC+3, ο χρήστης Carlos Nepomuceno 
έγραψε:

> Hey guys! Come on!!!
> Repeat with me: "Googsfraba!"

You are not and Jack Nicholson and this is not an Anger Management lesson 
(which was a great movie btw).

I'am the one that i should chant that mantra because instead of receiving 
helpfull replies i get that kind of responses.

Now, is anyone willing to help me on this please?
I also accept hints on how to solve this!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Encodign issue in Python 3.3.1 (once again)

2013-05-30 Thread nagia . retsina
Τη Πέμπτη, 30 Μαΐου 2013 1:53:33 μ.μ. UTC+3, ο χρήστης nagia@gmail.com 
έγραψε:
> Τη Πέμπτη, 30 Μαΐου 2013 12:29:56 μ.μ. UTC+3, ο χρήστης Michael Torrie έγραψε:
> 
> > On 05/29/2013 04:30 AM, nagia.rets...@gmail.com wrote:
> 
> > 
> 
> > > What makes us o sure it is a pymysql issue and not python's encoding
> 
> > 
> 
> > > issue?
> 
> > 
> 
> > 
> 
> > 
> 
> > The original traceback, which showed that the encoding error was
> 
> > 
> 
> > happening in
> 
> > 
> 
> > "/opt/python3/lib/python3.3/site-packages/pymysql/cursors.py", line 108.
> 
> > 
> 
> >  As was said, you solve that by passing a charset="utf-8" to the
> 
> > 
> 
> > connection string.
> 
> > 
> 
> > 
> 
> > 
> 
> > So doing that solved the encoding problem (a query is now being
> 
> > 
> 
> > successfully built and sent to mysql) and went on to expose another
> 
> > 
> 
> > problem (bug) in your code, but I cannot tell what that is, since the
> 
> > 
> 
> > error happened in a subprocess and the traceback got sent to /dev/null.
> 
> > 
> 
> >  I suspect is has something to do with how the query results are being
> 
> > 
> 
> > returned, or it could have something to do with the query itself.
> 
> > 
> 
> > Python DB API does not specify exactly which style of prepared
> 
> > 
> 
> > statements should be used by a given third-party module.  So differences
> 
> > 
> 
> > in syntax between how pymysql and MysqlDB define the variables could be
> 
> > 
> 
> > the problem.
> 
> > 
> 
> > 
> 
> > 
> 
> > In any case your course is clear.  Run pelatologio.py outside of your
> 
> > 
> 
> > templating system and see what the traceback says exactly now that the
> 
> > 
> 
> > charset issue is fixed.
> 
> 
> 
> Good morning Michael,
> 
> 
> 
> I'am afraid as much as you dont want to admin it that the moment i append the 
> charset directive into the connections tring i receive a huge error which it 
> can be displayed in:
> 
> 
> 
> http://superhost.gr/cgi-bin/pelatologio.py
> 
> 
> 
> This is run directly isolated form the templating system.

AttributeError: 'NoneType' object has no attribute 'id' 
  args = ("'NoneType' object has no attribute 'id'",) 
  with_traceback = 

is the error while i have no id varibale just an 'ID' inside:

cur.execute('''SELECT ID FROM clients WHERE name = %s''', (name,) )
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Encodign issue in Python 3.3.1 (once again)

2013-05-30 Thread nagia . retsina
Τη Πέμπτη, 30 Μαΐου 2013 12:29:56 μ.μ. UTC+3, ο χρήστης Michael Torrie έγραψε:
> On 05/29/2013 04:30 AM, nagia.rets...@gmail.com wrote:
> 
> > What makes us o sure it is a pymysql issue and not python's encoding
> 
> > issue?
> 
> 
> 
> The original traceback, which showed that the encoding error was
> 
> happening in
> 
> "/opt/python3/lib/python3.3/site-packages/pymysql/cursors.py", line 108.
> 
>  As was said, you solve that by passing a charset="utf-8" to the
> 
> connection string.
> 
> 
> 
> So doing that solved the encoding problem (a query is now being
> 
> successfully built and sent to mysql) and went on to expose another
> 
> problem (bug) in your code, but I cannot tell what that is, since the
> 
> error happened in a subprocess and the traceback got sent to /dev/null.
> 
>  I suspect is has something to do with how the query results are being
> 
> returned, or it could have something to do with the query itself.
> 
> Python DB API does not specify exactly which style of prepared
> 
> statements should be used by a given third-party module.  So differences
> 
> in syntax between how pymysql and MysqlDB define the variables could be
> 
> the problem.
> 
> 
> 
> In any case your course is clear.  Run pelatologio.py outside of your
> 
> templating system and see what the traceback says exactly now that the
> 
> charset issue is fixed.

Good morning Michael,

I'am afraid as much as you dont want to admin it that the moment i append the 
charset directive into the connections tring i receive a huge error which it 
can be displayed in:

http://superhost.gr/cgi-bin/pelatologio.py

This is run directly isolated form the templating system.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Encodign issue in Python 3.3.1 (once again)

2013-05-30 Thread nagia . retsina
Can ypou tell me how to install MySQLdb in python 3 using pip?

pip install MySQLdb doesnt find the module.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Encodign issue in Python 3.3.1 (once again)

2013-05-29 Thread nagia . retsina
What makes us o sure it is a pymysql issue and not python's encoding issue?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread nagia . retsina
But i think iam gonna fight it some more because mysqldb in python 3 has issues 
too :(
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread nagia . retsina
Τη Τρίτη, 28 Μαΐου 2013 9:19:21 μ.μ. UTC+3, ο χρήστης Michael Torrie έγραψε:
> On 05/28/2013 12:08 PM, nagia.rets...@gmail.com wrote:
> 
> > Τη Τρίτη, 28 Μαΐου 2013 8:17:05 μ.μ. UTC+3, ο χρήστης Michael Torrie
> 
> > έγραψε:
> 
> > 
> 
> >> Basically you want pelatologio.py to run and then you process the
> 
> >> output through a template, correct?
> 
> > 
> 
> > That is correct.
> 
> > 
> 
> >> Inside pelatologio.py there is some object that you are trying to
> 
> >> reference the "id" attribute on it does not contain id. So the
> 
> >> problem is in pelatologio.py.  Double check your code there.  Try 
> 
> >> to make a standalone test file you can run locally.
> 
> > 
> 
> > I have, i see no error, the error appears only when i append the
> 
> > charset directive into the connector, if i remove it the error
> 
> > dissapears.
> 
> 
> 
> No, when you remove the charset directive your database call fails and
> 
> thus things fail even earlier.

Yes, it does create issues.
i just tried to add it to metrites.py for testing and it breaks too.

https://github.com/petehunt/PyMySQL/issues/38

Switching back to MySQLdb.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Encodign issue in Python 3.3.1 (once again)

2013-05-28 Thread nagia . retsina
Τη Τρίτη, 28 Μαΐου 2013 8:17:05 μ.μ. UTC+3, ο χρήστης Michael Torrie έγραψε:

> Basically you want pelatologio.py to run and then you process the output
> through a template, correct?

That is correct.

> Inside pelatologio.py
> there is some object that you are trying to reference the "id" attribute
> on it does not contain id.
> So the problem is in pelatologio.py.  Double check your code there.  Try
> to make a standalone test file you can run locally.

I have, i see no error, the error appears only when i append the charset 
directive into the connector, if i remove it the error dissapears.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: TypeError: unsupported operand type(s) for %: 'NoneType' and 'tuple'

2013-05-26 Thread nagia . retsina
Τη Κυριακή, 26 Μαΐου 2013 4:10:02 μ.μ. UTC+3, ο χρήστης Chris Angelico έγραψε:
> On Sun, May 26, 2013 at 11:00 PM, Νίκος Γκρ33κ  wrote:
> 
> > Anyone seeign somethign wrong?
> 
> 
> 
> Yes. You're posting requests, then bumping the thread two hours later
> 
> as though you're entitled to a response quicker than that. Plus, the
> 
> problems you're seeing ought to be solved by the 2to3 utility. Use it.
> 
> Look at its output.
> 
> 
> 
> ChrisA

There is a tool that convert python 2.6.x code => python 3.x ?

Can you post a link to that toll plz?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-17 Thread nagia . retsina
Τη Κυριακή, 14 Απριλίου 2013 12:28:32 μ.μ. UTC+3, ο χρήστης Cameron Simpson 
έγραψε:
> On 13Apr2013 23:00, nagia.rets...@gmail.com  wrote:
> 
> | root@nikos [/home/nikos/public_html/foo-py]# pwd
> 
> | /home/nikos/public_html/foo-py
> 
> | root@nikos [/home/nikos/public_html/foo-py]# cat foo.py 
> 
> | #!/bin/sh
> 
> | exec 2>>/home/nikos/cgi.err.out
> 
> | echo "$0 $*" >&2
> 
> | id >&2
> 
> | env | sort >&2
> 
> | set -x
> 
> | exec /full/path/to/foo-py ${1+"$@"}
> 
> | 
> 
> | root@nikos [/home/nikos/public_html/foo-py]# python3 foo.py 
> 
> |   File "foo.py", line 2
> 
> | exec 2>>/home/nikos/cgi.err.out
> 
> |  ^
> 
> | SyntaxError: invalid syntax
> 
> 
> 
> That is because foo.py isn't a python script anymore, it is a shell script.
> 
> Its purpose is to divert stderr to a file and to recite various
> 
> things about the environment to that file in addition to any error
> 
> messages.
> 
> 
> 
> Just run it directly:
> 
> 
> 
>   ./foo.py
> 
> 
> 
> The #! line should cause it to be run by the shell.
> 
> 
> 
> I also recommend you try to do all this as your normal user account.
> 
> Root is for administration, such as stopping/starting apache and
> 
> so on. Not test running scripts from the command line; consider:
> 
> if the script has bugs, as root it can do an awful lot of damage.
> 
> 
> 
> | root@nikos [/home/nikos/public_html/foo-py]# 
> 
> | As far as thr tail -f of the error_log:
> 
> | root@nikos [/home/nikos/public_html]# touch /var/log/httpd/error_log
> 
> 
> 
> That won't do you much good; apache has not opened it, and so it
> 
> will not be writing to it. It was writing to a file of that name,
> 
> but you removed that file. Apache probably still has its hooks in the old
> 
> file (which now has no name).
> 
> 
> 
> Restarting apache should open (or create if missing) this file for you.
> 
> 
> 
> | root@nikos [/home/nikos/public_html]# tail -f /var/log/httpd/error_log
> 
> | and its empty even when at the exact same time i run 'python3
> 
> | metrites.py' from another interactive prompt when it supposed to
> 
> | give live feed of the error messages.
> 
> 
> 
> No, _apache_ writes to that file. So only when you visit the web
> 
> page will stuff appear there.
> 
> 
> 
> If you just run things from the command line, error messages will appear on 
> your terminal. Or, after this line of the wrapper script:
> 
> 
> 
>   exec 2>>/home/nikos/cgi.err.out
> 
> 
> 
> the error messages will appear in cgi.err.out.
> 
> 
> 
> | Cameron would it be too much to ask to provide you with root
> 
> | access to my VPS server so you can have a look there too?
> 
> | i can pay you if you like if you wait a few days to gather some money.
> 
> 
> 
> I really do not recommend that:
> 
> 
> 
>   - it is nuts to blithely allow a stranger root access to your system
> 
>   - you won't learn anything about CGI scripts
> 
> 
> 
> What you need for further debugging of your python issues is access
> 
> to the error messages from the CGI script. That is the purpose of
> 
> the wrapper script.
> 
> 
> 
> Get the wrapper running on the command line and then test it via the browser.
> 
> 
> 
> Cheers,
> 
> -- 
> 
> Cameron Simpson 
> 
> 
> 
> Lord grant me the serenity to accept the things I can not change,
> 
>  the courage to change the things that I can,
> 
> and the wisdom to hide the bodies of those people I had to kill
> 
>  because they pissed me off.
> 
> - Jeffrey Papen 
cameron,

can you help please or tell me what else i need to try?
Hello
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-14 Thread nagia . retsina
Τη Κυριακή, 14 Απριλίου 2013 12:28:32 μ.μ. UTC+3, ο χρήστης Cameron Simpson 
έγραψε:
> On 13Apr2013 23:00, nagia.rets...@gmail.com  wrote:
> 
> | root@nikos [/home/nikos/public_html/foo-py]# pwd
> 
> | /home/nikos/public_html/foo-py
> 
> | root@nikos [/home/nikos/public_html/foo-py]# cat foo.py 
> 
> | #!/bin/sh
> 
> | exec 2>>/home/nikos/cgi.err.out
> 
> | echo "$0 $*" >&2
> 
> | id >&2
> 
> | env | sort >&2
> 
> | set -x
> 
> | exec /full/path/to/foo-py ${1+"$@"}
> 
> | 
> 
> | root@nikos [/home/nikos/public_html/foo-py]# python3 foo.py 
> 
> |   File "foo.py", line 2
> 
> | exec 2>>/home/nikos/cgi.err.out
> 
> |  ^
> 
> | SyntaxError: invalid syntax
> 
> 
> 
> That is because foo.py isn't a python script anymore, it is a shell script.
> 
> Its purpose is to divert stderr to a file and to recite various
> 
> things about the environment to that file in addition to any error
> 
> messages.
> 
> 
> 
> Just run it directly:
> 
> 
> 
>   ./foo.py
> 
> 
> 
> The #! line should cause it to be run by the shell.
> 
> 
> 
> I also recommend you try to do all this as your normal user account.
> 
> Root is for administration, such as stopping/starting apache and
> 
> so on. Not test running scripts from the command line; consider:
> 
> if the script has bugs, as root it can do an awful lot of damage.
> 
> 
> 
> | root@nikos [/home/nikos/public_html/foo-py]# 
> 
> | As far as thr tail -f of the error_log:
> 
> | root@nikos [/home/nikos/public_html]# touch /var/log/httpd/error_log
> 
> 
> 
> That won't do you much good; apache has not opened it, and so it
> 
> will not be writing to it. It was writing to a file of that name,
> 
> but you removed that file. Apache probably still has its hooks in the old
> 
> file (which now has no name).
> 
> 
> 
> Restarting apache should open (or create if missing) this file for you.
> 
> 
> 
> | root@nikos [/home/nikos/public_html]# tail -f /var/log/httpd/error_log
> 
> | and its empty even when at the exact same time i run 'python3
> 
> | metrites.py' from another interactive prompt when it supposed to
> 
> | give live feed of the error messages.
> 
> 
> 
> No, _apache_ writes to that file. So only when you visit the web
> 
> page will stuff appear there.
> 
> 
> 
> If you just run things from the command line, error messages will appear on 
> your terminal. Or, after this line of the wrapper script:
> 
> 
> 
>   exec 2>>/home/nikos/cgi.err.out
> 
> 
> 
> the error messages will appear in cgi.err.out.
> 
> 
> 
> | Cameron would it be too much to ask to provide you with root
> 
> | access to my VPS server so you can have a look there too?
> 
> | i can pay you if you like if you wait a few days to gather some money.
> 
> 
> 
> I really do not recommend that:
> 
> 
> 
>   - it is nuts to blithely allow a stranger root access to your system
> 
>   - you won't learn anything about CGI scripts
> 
> 
> 
> What you need for further debugging of your python issues is access
> 
> to the error messages from the CGI script. That is the purpose of
> 
> the wrapper script.
> 
> 
> 
> Get the wrapper running on the command line and then test it via the browser.
> 
> 
> 
> Cheers,
> 
> -- 
> 
> Cameron Simpson 
> 
> 
> 
> Lord grant me the serenity to accept the things I can not change,
> 
>  the courage to change the things that I can,
> 
> and the wisdom to hide the bodies of those people I had to kill
> 
>  because they pissed me off.
> 
> - Jeffrey Papen 

Well i trust you because you are the only one along with Lele that are helpimg 
me here:

i tried what you said:

root@nikos [/home/nikos/public_html/cgi-bin]# service httpd restart
root@nikos [/home/nikos/public_html/cgi-bin]# python3 metrites.py 
root@nikos [/home/nikos/public_html]# cd foo-py/
root@nikos [/home/nikos/public_html/foo-py]# ls
./  ../  foo.py*
root@nikos [/home/nikos/public_html/foo-py]# ./foo.py 
root@nikos [/home/nikos/public_html/foo-py]# cd ..
root@nikos [/home/nikos/public_html]# cat cgi.err.out 
root@nikos [/home/nikos/public_html/cgi-bin]# cat /var/log/httpd/error_log 
root@nikos [/home/nikos/public_html/cgi-bin]# 

and i have run the script form browser but i still see nothing.

I insist that you will make the most of this if you access the VPS yourself.
it runs CentOS 6.4

Please accept, i trust you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-13 Thread nagia . retsina
Τη Τετάρτη, 10 Απριλίου 2013 12:10:13 π.μ. UTC+3, ο χρήστης Νίκος Γκρ33κ έγραψε:
> Hello, iam still trying to alter the code form python 2.6 => 3.3
> 
> 
> 
> Everyrging its setup except that unicode error that you can see if you go to 
> http://superhost.gr
> 
> 
> 
> Can anyone help with this?
> 
> I even tried to change print() with sys.stdout.buffer() but still i get the 
> same unicode issue.
> 
> 
> 
> I don't know what to try anymore.

root@nikos [/home/nikos/public_html/foo-py]# pwd
/home/nikos/public_html/foo-py
root@nikos [/home/nikos/public_html/foo-py]# cat foo.py 
#!/bin/sh
exec 2>>/home/nikos/cgi.err.out
echo "$0 $*" >&2
id >&2
env | sort >&2
set -x
exec /full/path/to/foo-py ${1+"$@"}

root@nikos [/home/nikos/public_html/foo-py]# python3 foo.py 
  File "foo.py", line 2
exec 2>>/home/nikos/cgi.err.out
 ^
SyntaxError: invalid syntax
root@nikos [/home/nikos/public_html/foo-py]# 

As far as thr tail -f of the error_log:

root@nikos [/home/nikos/public_html]# touch /var/log/httpd/error_log
root@nikos [/home/nikos/public_html]# tail -f /var/log/httpd/error_log

and its empty even when at the exact same time i run 'python3 metrites.py' from 
another interactive prompt when it supposed to give live feed of the error 
messages.

Cameron would it be too much to ask to provide you with root access to my VPS 
server so you can have a look there too?

i can pay you if you like if you wait a few days to gather some money.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-13 Thread nagia . retsina
Τη Σάββατο, 13 Απριλίου 2013 1:28:07 μ.μ. UTC+3, ο χρήστης Cameron Simpson 
έγραψε:
> On 12Apr2013 21:50, nagia.rets...@gmail.com  wrote:
> 
> | Ookey after that is corrected, i then tried the plain solution and i got 
> this response back form the shell:
> 
> | 
> 
> | Traceback (most recent call last):
> 
> |   File "metrites.py", line 213, in 
> 
> | htmldata = f.read()
> 
> |   File "/root/.local/lib/python2.7/lib/python3.3/encodings/iso8859_7.py", 
> line 23, in decode
> 
> | return codecs.charmap_decode(input,self.errors,decoding_table)[0]
> 
> | UnicodeDecodeError: 'charmap' codec can't decode byte 0xae in position 47: 
> character maps to 
> 
> | 
> 
> | then i switched to:
> 
> | 
> 
> | with open('/home/nikos/www/' + page, encoding='utf-8') as f:
> 
> | htmldata = f.read()
> 
> | 
> 
> | and i got no error at all, just pure run *from the shell*!
> 
> 
> 
> Ok, so you need to specify utf-8 to decode the file. Good.
> 
> 
> 
> | But i get internal server error when i try to run the webpage from the 
> browser(Chrome).
> 
> 
> 
> That is standard for a CGI script that does not complete successfully.
> 
> 
> 
> | So, can you tell me please where can i find the apache error log so to 
> display here please?
> 
> 
> 
> That depends on the install. Have a look in /var/log/apache or similar.
> 
> Otherwise you need to find the httpd.conf for the apache and look
> 
> for its log coniguration settings.
> 
> 
> 
> | Apcher error_log is always better than running 'python3 metrites.py' 
> because even if the python script has no error apache will also display more 
> web related things?
> 
> 
> 
> The error log is where error messages from CGI scripts go. And other error 
> messages.
> 
> It is very useful when testing CGI scripts.
> 
> 
> 
> Of course, it's best to work out as much as possible from the command
> 
> line first; you have much more direct control and access to errors
> 
> there. That only gets you so far though; the environment the CGI
> 
> script runs in is not the same as your command line, and some
> 
> different behaviour can come from this.
> 
> 
> 
> BTW, are you sure python3 is running your CGI script?
> 
> Also, the CGI script may not be running as you, but as the apache user.
> 
> In that case, it may fail if it does not has permission to access various
> 
> files owned by you.
> 
> 
> 
> Anyway, you need to see the error messages to work this out.
> 
> 
> 
> If you can't find the error log you can divert stderr at the
> 
> start of your python program:
> 
> 
> 
>   sys.stderr = open('/home/nikos/cgi.err.out', 'a')
> 
> 
> 
> and watch that in a shell:
> 
> 
> 
>   tail -f cgi.err.out
> 
> 
> 
> Cheers,
> 
> -- 
> 
> Cameron Simpson 
> 
> 
> 
> If you 'aint falling off, you ar'nt going hard enough.  - Fred Gassit

root@macgyver [/home/nikos/public_html/cgi-bin]# ls ../cgi.err.out 
../cgi.err.out
root@macgyver [/home/nikos/public_html/cgi-bin]# cat ../cgi.err.out 
root@macgyver [/home/nikos/public_html/cgi-bin]# 

Also i have foudn the error log and i tried to view it but it was empty and 
then i removed it and then run the script both from shell and broswer but it 
didnt reappeared.

root@macgyver [/home/nikos/public_html/cgi-bin]# cat /var/log/httpd/error_log
cat: /var/log/httpd/error_log: No such file or directory
root@macgyver [/home/nikos/public_html/cgi-bin]# 

Maybe its somehtign wron with my enviroment?
Should we check the Apache and CGI enviroment somehow and also make sure as you 
say that *I* run the CGI scripts and not user 'Apache' ?

Tell me what commands i should issues please and i will display the output to 
you.

Thank you Cameron, for helpimg me. Somehow the script doesnt seem to be the 
issue in  my VPS.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-12 Thread nagia . retsina
Τη Σάββατο, 13 Απριλίου 2013 4:41:57 π.μ. UTC+3, ο χρήστης Cameron Simpson 
έγραψε:
> On 11Apr2013 09:55, Nikos  wrote:
> 
> | Τη Πέμπτη, 11 Απριλίου 2013 1:45:22 μ.μ. UTC+3, ο χρήστης Cameron Simpson 
> έγραψε:
> 
> | > On 10Apr2013 21:50, nagia.rets...@gmail.com  
> wrote:
> 
> | > | the doctype is coming form the attempt of script metrites.py to open 
> and read the 'index.html' file.
> 
> | > | But i don't know how to try to open it as a byte file instead of an 
> tetxt file.
> 
> 
> 
> Lele Gaifax showed one way:
> 
> 
> 
> from codecs import open
> 
> with open('index.html', encoding='utf-8') as f:
> 
> content = f.read()
> 
> 
> 
> But a plain open() should also do:
> 
> 
> 
> with open('index.html') as f:
> 
> content = f.read()
> 
> 
> 
> if you're not taking tight control of the file encoding.
> 
> 
> 
> The point here is to get _text_ (i.e. str) data from the file, not bytes.
> 
> 
> 
> If the text turns out to be incorrectly decoded (i.e. incorrectly
> 
> reading the file bytes and assembling them into text strings) because
> 
> the default encoding is wrong, then you may need to read for Lele's
> 
> more verbose open() example to select the correct encoding.
> 
> 
> 
> But first ignore that and get text (str) instead of bytes.
> 
> If you're already getting text from the file, something later is
> 
> making bytes and handing it to print().
> 
> 
> 
> Another approach to try is to use
> 
>   sys.stdout.write()
> 
> instead of
> 
>   print()
> 
> 
> 
> The print() function will take _anything_ and write text of some form.
> 
> The write() function will throw an exception if it gets the wrong type of 
> data.
> 
> 
> 
> If sys.stdout is opened in binary mode then write() will require
> 
> bytes as data; strings will need to be explicitly turned into bytes
> 
> via .encode() in order to not raise an exception.
> 
> 
> 
> If sys.stdout is open in text mode, write() will require str data.
> 
> The sys.stdout file itself will transcribe to bytes for you.
> 
> 
> 
> If you take that route, at least you will not have confusion about
> 
> str versus bytes.
> 
> 
> 
> For an HTML output page I would advocate arranging that sys.stdout
> 
> is in text mode; that way you can do the natural thing and .write()
> 
> str data and lovely UTF-8 bytes will come out the other end.
> 
> 
> 
> If the above test (using .write() instead of print()) shows it to
> 
> be in binary mode we can fix that. But you need to find out.
> 
> 
> 
> You will want access to the error messages from the CGI environment;
> 
> do you have access to the web servers error_log? You can tail that
> 
> in a terminal while you reload the page to see what's going on.
> 
> 
> 
> | This works in the shell, but doesn't work on my website:
> 
> | 
> 
> | $ cat utf8.txt
> 
> | υλικό!Πρόκειται γ
> 
> 
> 
> Ok, so your terminal is using UTF-8 as its output coding. (And so
> 
> is your mail posting program, since we see it unmangled on my screen
> 
> here.)
> 
> 
> 
> | $ python3
> 
> | Python 3.2.3 (default, Oct 19 2012, 20:10:41)
> 
> | [GCC 4.6.3] on linux2
> 
> | Type "help", "copyright", "credits" or "license" for more information.
> 
> | >>> data = open('utf8.txt').read()
> 
> | >>> print(data)
> 
> | υλικό!Πρόκειται γ
> 
> 
> 
> Likewise.
> 
> 
> 
> However, in an exciting twist, I seem to recall that Python invoked
> 
> interactively with aterminal as output will have the default terminal
> 
> encoding in place on sys.stdout. Producing what you expect. _However_,
> 
> python invoked in a batch environment where stdout is not a terminal
> 
> (such as in the CGI environment producing your web page), that is
> 
> _not_ necessarily the case.
> 
> 
> 
> | >>> print(data.encode('utf-8'))
> 
> | 
> b'\xcf\x85\xce\xbb\xce\xb9\xce\xba\xcf\x8c!\xce\xa0\xcf\x81\xcf\x8c\xce\xba\xce\xb5\xce\xb9\xcf\x84\xce\xb1\xce\xb9
>  \xce\xb3\n'
> 
> | 
> 
> | See, the last line is what i'am getting on my website.
> 
> 
> 
> The above line takes your Unicode text in "data" and transcribed
> 
> it to bytes using UTF-8 as the encoding. And print() is then receiving
> 
> that bytes object and printing its str() representation as "b''".
> 
> That str is itself unicode, and when print passes it to sys.stdout,
> 
> _that_ transcribed the unicode "b'...'" string as bytes to your
> 
> terminal. Using UTF-8 based on the previous examples above, but
> 
> since all those characters are in the bottom 127 code range the
> 
> byte sequence will be the same if it uses ASCII or ISO8859-1 or
> 
> almost anything else:-)
> 
> 
> 
> As you can see, there's a lot of encoding/decoding going on behind
> 
> the scenes even in this superficially simple example.
> 
> 
> 
> | If i remove
> 
> | the encode('utf-8') part in metrites.py, the webpage will not show
> 
> | anything at all...
> 
> 
> 
> Ah, but data will be being output. The print() function _will_ be
> 
> writing "data" out in some form.  I suggest you remove the .encode()
> 
> and then examine the _sou

Re: Unicode issue with Python v3.3

2013-04-12 Thread nagia . retsina
Τη Παρασκευή, 12 Απριλίου 2013 9:37:29 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
> On Fri, Apr 12, 2013 at 8:36 AM,   wrote:
> 
> > Τη Παρασκευή, 12 Απριλίου 2013 4:29:51 μ.μ. UTC+3, ο χρήστης rusi έγραψε:
> 
> >> On Apr 12, 6:18 pm, nagia.rets...@gmail.com wrote:
> 
> >> > Well, instead of being a smartass it would be nice if you could actually 
> >> > help for once.
> 
> >>
> 
> >> Interesting!
> 
> >>
> 
> >> Among the things which you dont seem to know is the meaning of the
> 
> >> word 'once'.
> 
> >
> 
> > Same applies for you too. Stop being smartasses.
> 
> 
> 
> Please keep in mind that this is a community of volunteers.  Nobody
> 
> here is being paid for their time to help you fix your website, and if
> 
> you manage to irritate us in the process, we're likely to just walk
> 
> away from it.
> 
> 
> 
> I looked over the code that you have provided us with, and based on
> 
> that I could not see any reason why the html would be in the form of a
> 
> bytes instead of a str.  Since nobody else here seems to have any
> 
> further insight into the problem either, you're just going to have to
> 
> find a a way to debug the code.  If you cannot do that on your own,
> 
> then I suggest that you find a contractor who can, hire them, and
> 
> grant them the access they need to do a real debugging session.
> 
> 
> 
> I would also recommend that in the future you should stop deploying
> 
> untested code to your production website.  Set up a development
> 
> environment for yourself, make the changes there, and only deploy when
> 
> you know that everything is working.

I agree with what you say except form the fact that i try to irritate people.
Look at the thread and you will see who's irritating whom first.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-12 Thread nagia . retsina
Τη Παρασκευή, 12 Απριλίου 2013 4:29:51 μ.μ. UTC+3, ο χρήστης rusi έγραψε:
> On Apr 12, 6:18 pm, nagia.rets...@gmail.com wrote:
> 
> > Τη Παρασκευή, 12 Απριλίου 2013 4:14:39 μ.μ. UTC+3, ο χρήστης Chris Angelico 
> > έγραψε:
> 
> >
> 
> > > On Fri, Apr 12, 2013 at 10:50 PM,   wrote:
> 
> >
> 
> > > > Someone HEELP ME!!
> 
> >
> 
> > >http://youtu.be/VxMYwjp8t0o
> 
> >
> 
> > > ChrisA
> 
> >
> 
> > Well, instead of being a smartass it would be nice if you could actually 
> > help for once.
> 
> 
> 
> Interesting!
> 
> Among the things which you dont seem to know is the meaning of the
> 
> word 'once'.

Same applies for you too. Stop being smartasses.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-12 Thread nagia . retsina
Τη Παρασκευή, 12 Απριλίου 2013 4:14:39 μ.μ. UTC+3, ο χρήστης Chris Angelico 
έγραψε:
> On Fri, Apr 12, 2013 at 10:50 PM,   wrote:
> 
> > Someone HEELP ME!!
> 
> 
> 
> http://youtu.be/VxMYwjp8t0o
> 
> 
> 
> ChrisA


Well, instead of being a smartass it would be nice if you could actually help 
for once.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-12 Thread nagia . retsina
Someone HEELP ME!!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-11 Thread nagia . retsina
Well, can somebody else propose somehting plz?

i have paste the whole script and even the necessary snippet that perhaps 
causing this encoding confusion in 3.3
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-11 Thread nagia . retsina
Of course here is how it look like:

if page.endswith('.html'):
f = open( "/home/nikos/www/" + page, encoding="utf-8" )
htmldata = f.read()
htmldata = htmldata % (quote, music)

counter = ''' 
  mailto:supp...@superhost.gr";> 
  
Αριθμός Επισκεπτών
http://superhost.gr/?show=log&page=%s";> %d 
  
  ''' % (page, data[0])
  
template = htmldata + counter
print( template )
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-11 Thread nagia . retsina
Τη Πέμπτη, 11 Απριλίου 2013 11:20:47 π.μ. UTC+3, ο χρήστης Steven D'Aprano 
έγραψε:
> On Thu, 11 Apr 2013 07:50:19 +, Steven D'Aprano wrote:
> 
> 
> 
> > On Thu, 11 Apr 2013 00:13:46 -0700, nagia.retsina wrote:
> 
> > 
> 
> >> Since now we k ow the problem maybe we can tell metrites.py to open
> 
> >> index.html using utf-8 encoding rather as binary, dont you think?
> 
> > 
> 
> > What makes you think it is UTF-8?
> 
> > 
> 
> > Last time you tried decoding content as UTF-8, you got an error that it
> 
> > wasn't a legal UTF-8 file.
> 
> 
> 
> Oops, sorry, correction. It wasn't a legal UTF-8 string. It was an 
> 
> environment variable that was causing the decoding error, since it 
> 
> contained illegal bytes for a UTF-8 string.
> 
> 
> 
> 
> 
> > Where does index.html come from? Whatever program generates that, you
> 
> > need to find out what encoding it is using.

Hello steven, index.html was writenn by handcode from me utilizing html + css

metrites.py tries to open that script so we must tell it to open as utf-8 text 
and not as a binary file.

How can we do that?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-11 Thread nagia . retsina
Since now we k ow the problem maybe we can tell metrites.py to open index.html 
using utf-8 encoding rather as binary, dont you think?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-10 Thread nagia . retsina
Firtly thank uou for taking a look into the code.

the doctype is coming form the attempt of script metrites.py to open and read 
the 'index.html' file.

But i don't know how to try to open it as a byte file instead of an tetxt file.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-10 Thread nagia . retsina
Τη Τετάρτη, 10 Απριλίου 2013 7:25:21 π.μ. UTC+3, ο χρήστης Steven D'Aprano 
έγραψε:

> What does os.environ['REMOTE_ADDR'] give? Until you answer that question, 
> you won't make any progress.

I insists stevv.

Look at what 'python3 metrites.py' gives me



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unicode issue with Python v3.3

2013-04-09 Thread nagia . retsina
Τη Τετάρτη, 10 Απριλίου 2013 12:34:25 π.μ. UTC+3, ο χρήστης Ian έγραψε:
> On Tue, Apr 9, 2013 at 3:10 PM, Νίκος Γκρ33κ  wrote:
> 
> > Hello, iam still trying to alter the code form python 2.6 => 3.3
> 
> >
> 
> > Everyrging its setup except that unicode error that you can see if you go 
> > to http://superhost.gr
> 
> >
> 
> > Can anyone help with this?
> 
> > I even tried to change print() with sys.stdout.buffer() but still i get the 
> > same unicode issue.
> 
> >
> 
> > I don't know what to try anymore.
> 
> 
> 
> It seems to be failing on the line:
> 
> 
> 
> host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
> 
> 
> 
> So the obvious question to ask is: what are the contents of
> 
> os.environ['REMOTE_ADDR'] when this line is reached?
> 
> 
> 
> And why are you still trying to solve these sorts of problems on your
> 
> production website?  Do you not have a development or staging
> 
> environment?

No forget this line. this is not the problem.
No i don't have  a testing enviroment, i altered all the code form 2.6 to 3.3 
in the live enviromtnt.

i strongly believe there is somethign goind wrong with the prints(). Thoese are 
causing the unicode isu es much like as thes changes from:

quote = random.choice( list( open( "/home/nikos/www/data/private/quotes.txt", ) 
) )

quote = random.choice( list( open( "/home/nikos/www/data/private/quotes.txt", 
encoding="utf-8" ) ) )

in order for the open() to work.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Reseller Host with Python 3 support

2013-04-02 Thread nagia . retsina
An offer someone please?
-- 
http://mail.python.org/mailman/listinfo/python-list


Reseller Hosting Plan with Python 3 support

2013-04-02 Thread nagia . retsina
I'am looking for this:

Reseller Plan with 200$ per year

α) 20 GB ftp quota
b) 200 GB traffic
c) cPanel
d) Python 3
e) Python MySQLdb module
f) ssh support


Please make the best offer possible.
Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Switching from Apche to LiteSpeed

2013-04-01 Thread nagia . retsina
Τη Δευτέρα, 1 Απριλίου 2013 11:29:47 μ.μ. UTC+3, ο χρήστης John Gordon έγραψε:
> In <9a35850a-7fcb-4585-84ae-5e13cef91...@googlegroups.com> 
> =?ISO-8859-7?B?zd/q7/Igw+rxMzPq?=  writes:
> 
> 
> 
> > Just today i changed from HostGator to EZPZ, which means from Apache Web 
> > Server to LiteSpeed.
> 
> 
> 
> > Does anyone know why iam seeing what iam seeing at http://superhost.gr
> 
> 
> 
> > I see weird encoding although inside my python script i have:
> 
> 
> 
> > #!/usr/bin/python
> 
> > # -*- coding=utf-8 -*
> 
> 
> 
> I believe the syntax is to use a colon, not an equal sign.  i.e.:
> 
> 
> 
> # -*- coding: utf-8 -*-
> 
> 
> 
> Your example is also missing the final dash after the asterisk.
> 
> 
> 
> -- 
> 
> John Gordon   A is for Amy, who fell down the stairs
> 
> gor...@panix.com  B is for Basil, assaulted by bears
> 
> -- Edward Gorey, "The Gashlycrumb Tinies"

Thank you but even like you said i still see ncoding issues as seen in my 
webpage
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: No errors displayed but i blank scren nstead.

2013-03-29 Thread nagia . retsina
Τη Παρασκευή, 29 Μαρτίου 2013 9:34:07 μ.μ. UTC+2, ο χρήστης Chris Angelico 
έγραψε:
> On Sat, Mar 30, 2013 at 6:27 AM,   wrote:
> 
> > But now iam also receivein this error message as shown here when i switches 
> > to 'pymysql'
> 
> 
> 
> Why the change of email address? Are you trying to dodge killfiles?
> 
> 
> 
> ChrisA

No, someone else is using this computer too along with Chrome and Chrome 
associates his mail address with all google services and i was under the 
impression i was sposting from my gmail group account. Sorry for that. it 
happened many tiems alrready as i noticed days ago too.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: No errors displayed but i blank scren nstead.

2013-03-29 Thread nagia . retsina
But now iam also receiving this error message as shown here when i switches to 
'pymysql'
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: No errors displayed but i blank scren nstead.

2013-03-29 Thread nagia . retsina
But now iam also receivein this error message as shown here when i switches to 
'pymysql'
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: No errors displayed but i blank scren nstead.

2013-03-29 Thread nagia . retsina
Τη Πέμπτη, 28 Μαρτίου 2013 4:19:47 μ.μ. UTC+2, ο χρήστης Νίκος Γκρ33κ έγραψε:
> Fianlly my cgi .py script doesnt produce any more errors, i think i ahve 
> correct them but it present a blank screen
> 
> 
> 
> http://superhost.gr
> 
> 
> 
> Any idea why?
> 
> What should i check?

Thants not the issue, that message uses to be shown in comamnd line even woith 
python 2.6

somehting else is wrong here and it shwos blank pages.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Cannot run a single MySQLdb execute....

2013-03-29 Thread nagia . retsina
Τη Παρασκευή, 29 Μαρτίου 2013 7:39:20 μ.μ. UTC+2, ο χρήστης Alan Meyer έγραψε:
> On 03/29/2013 01:32 PM, Alan Meyer wrote:
> 
> 
> 
> > However, MySQLdb is a well established module and what you're asking it
> 
> > to do is very simple and very standard.
> 
> 
> 
> Oh, sorry, I see that you already said that mysqldb won't work with 
> 
> python 3.  My comments in the last message are irrelevant.
> 
> 
> 
> Sorry again.
> 
> 
> 
> Good luck.
> 
> 
> 
>  Alan

Thanks Alan i decided to work with 'pymysql' and iam struggling to egt thbis 
working but i still receive the same blank page for some unknown reason.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: MySQLdbd error. Perhpas it isn't installed?

2013-03-27 Thread nagia . retsina
Τη Τετάρτη, 27 Μαρτίου 2013 6:48:44 μ.μ. UTC+2, ο χρήστης MRAB έγραψε:
> On 27/03/2013 06:42, Νίκος Γκρ33κ wrote:
> 
> > Τη Τετάρτη, 27 Μαρτίου 2013 6:26:06 π.μ. UTC+2, ο χρήστης ru...@yahoo.com 
> > έγραψε:
> 
> >
> 
> >> If not, maybe you can try adding a print statement to your code that
> 
> >> will print the value of 'page'.  This will be easier to do if you
> 
> >> can run you code interactively.  If you have to run it via a webserver
> 
> >> than maybe you'll need wrap the print output in html commands to make
> 
> >> it visible on the page, or to write it to a file.
> 
> >
> 
> >
> 
> > I tried what you suggested by doign the following:
> 
> >
> 
> > print( page )
> 
> > sys.exit(0)
> 
> > cur.execute( '''SELECT hits FROM counters WHERE url = %s''', (page,) )
> 
> >
> 
> >
> 
> > and the result is printed in the webpage as 'index.html'
> 
> >
> 
> > so page seem s to be a string but the error is still persistant.
> 
> > Anything else i need to try?
> 
> >
> 
> A brief look at the documentation tells me that MySQL uses '?' as the
> 
> placeholder instead of '%s':
> 
> 
> 
> cur.execute('''SELECT hits FROM counters WHERE url = ?''', (page, ))

But as i have it used to work withour problem with pyhton 2.6
Why would it be a problem now?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: This mail never gets delivered. Any ideas why?

2013-03-11 Thread nagia . retsina
Thank you Thomas but that simple line as i have it now its capable of sending 
mail successfully wven with greek letters two in subject or in message 
variables.

Now need to dad additional extra code for it to work.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: An error when i switched from python v2.6.6 => v3.2.3

2013-03-08 Thread nagia . retsina
Τη Σάββατο, 9 Μαρτίου 2013 2:26:56 π.μ. UTC+2, ο χρήστης Ian έγραψε:
> On Fri, Mar 8, 2013 at 1:31 PM, Νίκος Γκρ33κ  wrote:
> 
> > Thank you very much for pointing my flaws once again!
> 
> >
> 
> > I cant beleive how easy you hacked the webserver again and be able to read 
> > my cgi scripts source and write to cgi-bin too!
> 
> >
> 
> > I have added extra security by following some of your advice, i wonder if 
> > youc an hack it again!
> 
> >
> 
> > Fell free to try if i'am not tiring you please!
> 
> 
> 
> That seems to be better, although I want to stress that I did not try
> 
> very hard.  It's possible that somebody with more patience and
> 
> imagination than myself might still find a way to fool your
> 
> validation.

I'am glad the script has been made more secure after of course you enilghten me 
and i followed your advice. Here is what i did:


# detect how 'index.html' is called and validate values of 'htmlpage' & 'page'
if page and os.path.isfile( '/home/nikos/www/cgi-bin/' + page ):
page = page
elif form.getvalue('show') and os.path.isfile( htmlpage ):
page = htmlpage.replace( '/home/nikos/public_html/', '' )
else:
page = 'index.html'

Now that you have the if structure's logic can you *still* fool the script?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: An error when i switched from python v2.6.6 => v3.2.3

2013-03-08 Thread nagia . retsina
Τη Παρασκευή, 8 Μαρτίου 2013 8:54:15 μ.μ. UTC+2, ο χρήστης Steven D'Aprano 
έγραψε:

> >>> -c ''; rm -rf /; oops.py

> Please don't tell the newbies to destroy their system, no matter how 
> tempting it might be.

What that "-c ''" options i keep seeing in the attempts to pass bogus info in 
my 'page' variable?

And hows oops.py relevant? Such file doesnt nto exist in my webssever.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sync databse table based on current directory data without losign previous values

2013-03-06 Thread nagia . retsina
Τη Τετάρτη, 6 Μαρτίου 2013 4:04:26 μ.μ. UTC+2, ο χρήστης Michael Ross έγραψε:
> On Wed, 06 Mar 2013 12:52:00 +0100, Mark Lawrence  
> 
>  wrote:
> 
> 
> 
> > On 06/03/2013 07:45, Νίκος Γκρ33κ wrote:
> 
> >> I'am using this snipper to read a current directory and insert all  
> 
> >> filenames into a databse and then display them.
> 
> >>
> 
> >> But what happens when files are get removed form the directory?
> 
> >> The inserted records into databse remain.
> 
> >> How can i update  the databse to only contain the existing filenames  
> 
> >> without losing the previous stored data?
> 
> >>
> 
> >> Here is what i ahve so far:
> 
> >>
> 
> >> ==
> 
> >> path = "/home/nikos/public_html/data/files/"
> 
> >>
> 
> >> #read the containing folder and insert new filenames
> 
> >> for result in os.walk(path):
> 
> >
> 
> > You were told yesterday at least twice that os.walk returns a tuple but  
> 
> > you still insist on refusing to take any notice of our replies when it  
> 
> > suits you, preferring instead to waste everbody's time with these  
> 
> > questions.  Or are you trying to get into the Guinness Book of World  
> 
> > Records for the laziest bastard on the planet?
> 
> 
> 
> Hold on a sec ...
> 
> 
> 
> He has
> 
> 
> 
> for result in os.walk(path):
> 
>   for filename in result[2]:
> 
> 
> 
> So he *did* take notice of that.
> 
> 
> 
> 
> 
> Nikos:
> 
> Expectation is to iterate through a tuple like this:
> 
> 
> 
> for dirpath, dirnames, filenames in os.walk(path):
> 
>   ...

Thank you Michael, yes i ahve understood that myself yesterday after one of the 
guys here have shown the output of os.walk(path) in IDLE. 
So, yes in fact i was in need for the 3rd item in the tuple, so to get hold on 
to the files.

Thank you for supporting me, some ppl here think i'am a troll and don't try 
thinks or ignore evrything but 'some_ppl's_opinion != True'

I'am just sometimes persistant on having thing my way that why i was calling my 
self Ferrous cRanus, which i changes it since it was annoying
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Embedding a for inside an html template for substitution

2013-03-04 Thread nagia . retsina
Τη Δευτέρα, 4 Μαρτίου 2013 5:14:00 μ.μ. UTC+2, ο χρήστης Νίκος Γκρ33κ έγραψε:
> Hello pythonistas!
> 
> 
> 
> I'am tryign to populate a table with dictionary keys and values:
> 
> 
> 
> Foe that iam using an html template and the questions is what i should write 
> inside 'files.html' so then then the python script populate the table.
> 
> 
> 
> 
> 
>   SuperHost - Economy
> 
>   Χώρος στο δίσκο: 1 GB
> 
>   Μηνιαία Κίνηση δεδομένων: 1 GB
> 
>   Control Panel: cPanel 11 & Fantastico Deluxe
> 
>   Domains: 1
> 
>   Subdomains: 1
> 
>   FTP Accounts: 1
> 
>   Emails (POP3): 2
> 
>   WebMail: [ RoundCube|Horde|Squirrel ]: ΝΑΙ
> 
>   Mysql Databases: 2
> 
> 
> 
> 
> 
> Instead of writing the above html data inside my html template how would i 
> write it with a for that then will be substituted by the python script?
> 
> 
> 
> can you please write an example for me that user "files.html" and gets 
> populates by "files.py" ?
> 
> 
> 
> i want os ee how it lloks like please!
> 
> 
> 
> Thank you.

Thank you Michael, i have decided to use cheetahtemplate. It seems nice and 
simple, djanfo indeed is an overkill for me needs.
-- 
http://mail.python.org/mailman/listinfo/python-list