Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'else:': 0.03; 'charset:iso-8859-7': 0.04; 'elif': 0.05; 'encoding': 0.05; 'correct.': 0.07; 'encoded': 0.07; 'none:': 0.07; 'rename': 0.07; 'stops': 0.07; "subject:' ": 0.07; 'utf-8': 0.07; 'clean.': 0.09; 'data:': 0.09; 'filename': 0.09; 'filenames': 0.09; 'filenames:': 0.09; 'host,': 0.09; 'moving.': 0.09; 'subject:Why': 0.09; 'subject:into': 0.09; 'try:': 0.09; 'cc:addr:python-list': 0.11; 'suggest': 0.14; 'thread': 0.14; '<form': 0.16; '<input': 0.16; "'''": 0.16; "'utf-8',": 0.16; '(filename,': 0.16; '12:57': 0.16; 'compute': 0.16; 'letting': 0.16; 'nick': 0.16; 'ought': 0.16; 'outputs': 0.16; 'spurious': 0.16; 'subject:format': 0.16; 'url:py': 0.16; 'utf8': 0.16; 'wrongly': 0.16; 'files.': 0.16; 'sat,': 0.16; 'hire': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'trying': 0.19; 'thanks.': 0.20; '8bit%:5': 0.22; 'code,': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'error': 0.23; 'skip': 0.24; 'skip:\xa0 20': 0.24; 'unicode': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; '15,': 0.26; 'switch': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'record': 0.27; 'idea': 0.28; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'assert': 0.31; 'correctly.': 0.31; "skip:' 40": 0.31; 'skip:= 40': 0.31; 'steven': 0.31; 'file': 0.32; 'another': 0.32; 'url:python': 0.33; 'skip:b 30': 0.33; 'noticed': 0.34; 'subject:the': 0.34; 'display': 0.35; 'except': 0.35; 'skip:u 20': 0.35; 'something': 0.35; 'convert': 0.35; 'received:google.com': 0.35; 'skip:\xd0 10': 0.36; 'url:listinfo': 0.36; 'next': 0.36; 'subject:?': 0.36; 'url:org': 0.36; 'button': 0.38; 'skip:& 10': 0.38; 'thank': 0.38; 'follows:': 0.38; 'skip:[ 10': 0.38; 'files': 0.38; 'pm,': 0.38; 'does': 0.39; 'delete': 0.39; 'skip:p 20': 0.39; 'url:mail': 0.40; 'skip:u 10': 0.60; 'is.': 0.60; 'most': 0.60; 'first': 0.61; 'you.': 0.62; 'name': 0.63; 'skip:n 10': 0.64; 'more': 0.64; 'total': 0.65; 'here': 0.66; 'mar': 0.68; 'anything.': 0.68; 'skip:a 40': 0.72; 'url:page': 0.74; '</td>': 0.84; '</tr>': 0.84; '<tr>': 0.84; 'hammer': 0.84; 'to:addr:support': 0.84; '8bit%:67': 0.93; 'browse': 0.95; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=nwaNXzv+/NWS6MaEOI9xW/TV2kNfCj9pAfofpmCZOCM=; b=h0U451WaxSMreKQ9I4BLq8eVVVyVW09z5M7+dVEz86/1KWdtDtTW4UQ7xz6Zbetzm4 ix1Di3ZZ5jyUmKYGN1h6ymLJIyjofPXImupl+o3eFEUzQ85ub6xJKTcUL5CMzOwTwLfd KL+SPUBEjFDYyJ5giOZbPXwDY1VkGd0gP5amFk+x9Wp+vkg57MbvfYsoQquX4b/1K39C B8T+K3Vv2tb/kP4MXxqoLQJsGd5FewrpUFwGSc6GWwMccWom6bhTcCPE7pPntqS1NSDT UykgdPp/It/7i1kSDkxBZeyduIJlE3dbbwjxUnPN+n+2soXtLHBP2DApkrSSqrsed4AE c75A== X-Received: by 10.152.29.169 with SMTP id l9mr3691506lah.31.1371325639108; Sat, 15 Jun 2013 12:47:19 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Jarrod Henry Date: Sat, 15 Jun 2013 14:46:59 -0500 Subject: Re: Why 'files.py' does not print the filenames into a table format? To: Nick the Gr33k Content-Type: multipart/alternative; boundary=089e0158bfde972e0504df36a1f0 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 391 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1371325647 news.xs4all.nl 15900 [2001:888:2000:d::a6]:41120 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:48356 --089e0158bfde972e0504df36a1f0 Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable Nick, at this point, you need to hire someone to do your work for you. We are not here to do your job. I would suggest finding a coder for hire and letting them do this job correctly. Thanks. On Sat, Jun 15, 2013 at 2:38 PM, Nick the Gr33k wrote= : > Hello, > > Trying to browse http://superhost.gr/?page=3D**files.pywith tailing -F of the error_log i noticed that error l= og outputs no error! > > So that means that the script is correct. > > here are the directory app's files. > > nikos@superhost.gr [~/www/data/apps]# ls -l > total 412788 > drwxr-xr-x 2 nikos nikos 4096 Jun 12 12:03 ./ > 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 > -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 45297713 Jun 10 12:38 Raptor\ Chess.exe > -rw-r--r-- 1 nikos nikos 25476584 Jun 2 19:50 Scrabble.exe > -rwxr-xr-x 1 nikos nikos 49141166 Mar 17 12:48 To\ 1o\ mou\ vivlio\ gia\ > to\ skaki.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 4 14:11 =C5=F5=F7=DE\ =F4=EF=F5\ = =C9=E7=F3=EF=FD.mp3 > -rwxr-xr-x 1 nikos nikos 66896732 Mar 17 13:13 =CA=EF=F3=EC=DC=F2\ =C1=E9= =F4=F9=EB=FC=F2\ -\ > =D0=F1=EF=F6=E7=F4=E5=DF=E5=F2.pdf* > -rw-r--r-- 1 nikos nikos 236032 Jun 4 14:10 =D3=EA=DD=F8=EF=F5\ =DD=ED= =E1=ED\ =E1=F1=E9=E8=EC=FC.exe > > > The code is as follows: > > # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D** > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > # Convert wrongly encoded filenames to utf-8 > # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D** > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > path =3D b'/home/nikos/public_html/**data/apps/' > filenames =3D os.listdir( path ) > > utf8_filenames =3D [] > > for filename in filenames: > # Compute 'path/to/filename' > filename_bytes =3D path + filename > encoding =3D guess_encoding( filename_bytes ) > > if encoding =3D=3D 'utf-8': > # File name is valid UTF-8, so we can skip to the next > file. > utf8_filenames.append( filename_bytes ) > continue > elif encoding is None: > # No idea what the encoding is. Hit it with a hammer unti= l > it stops moving. > filename =3D filename_bytes.decode( 'utf-8', > 'xmlcharrefreplace' ) > else: > filename =3D filename_bytes.decode( encoding ) > > # Rename the file to something which ought to be UTF-8 clean. > newname_bytes =3D filename.encode('utf-8') > os.rename( filename_bytes, newname_bytes ) > utf8_filenames.append( newname_bytes ) > > # Once we get here, the file ought to be UTF-8 clean and the > Unicode name ought to exist: > assert os.path.exists( newname_bytes.decode('utf-8') ) > > > # Switch filenames from utf8 bytestrings =3D> unicode strings > filenames =3D [] > > for utf8_filename in utf8_filenames: > filenames.append( utf8_filename.decode('utf-8') ) > > # Check the presence of a database file against the dir files and delete > record if it doesn't exist > cur.execute('''SELECT url FROM files''') > data =3D cur.fetchall() > > for url in data: > if url not in filenames: > # Delete spurious > cur.execute('''DELETE FROM files WHERE url =3D %s''', url= ) > > > # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D** > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > # Display ALL files, each with its own download button > # =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D** > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > print(''' >

> > ''') > > try: > cur.execute( '''SELECT * FROM files ORDER BY lastvisit DESC''' ) > data =3D cur.fetchall() > > for row in data: > (filename, hits, host, lastvisit) =3D row > lastvisit =3D lastvisit.strftime('%A %e %b, %H:%M') > > print(''' > > > > > > > > > ''' % (filename, hits, host, lastvisit) ) > print( '''
name=3D"filename" value=3D"%s">
> %s
> %s
> %s


''' ) > except pymysql.ProgrammingError as e: > print( repr(e) ) > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D**=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > PLEASE take a look, its not a huge code, the encoding was of Steven > idea's, so from another thread is a bit more or less already known to the > most of you. > > I just want to know why it doesn't print anything. > > Thank you and please whoever does not feel like helping, please at least > not spam the thread. > > -- > What is now proved was at first only imagined! > -- > http://mail.python.org/**mailman/listinfo/python-list > --089e0158bfde972e0504df36a1f0 Content-Type: text/html; charset=ISO-8859-7 Content-Transfer-Encoding: quoted-printable
Nick, at this point, you need to hire someone to do your work for you.

We are not here to do your job. =A0I would suggest finding a coder for hire= and letting them do this job correctly.

Thanks.


On Sat, Jun 15, 2013 at 2:38 PM, Nick the Gr33k <= ;support@superhos= t.gr> wrote:
Hello,

Trying to browse http://superhost.gr/?page=3Dfiles.py with tailing -F of= the error_log i noticed that error log outputs no error!

So that means that the script is correct.

here are the directory app's files.

nikos@superhost.gr<= /a> [~/www/data/apps]# ls -l
total 412788
drwxr-xr-x 2 nikos nikos =A0 =A0 4096 Jun 12 12:03 ./
drwxr-xr-x 6 nikos nikos =A0 =A0 4096 May 26 21:13 ../
-rwxr-xr-x 1 nikos nikos 13157283 Mar 17 12:57 100\ Mythoi\ tou\ Aiswpou.pd= f*
-rwxr-xr-x 1 nikos nikos 29524686 Mar 11 18:17 Anekdotologio.exe*
-rw-r--r-- 1 nikos nikos 42413964 Jun =A02 20:29 Battleship.exe
-rw-r--r-- 1 nikos nikos 51819750 Jun =A02 20:04 Luxor\ Evolved.exe
-rw-r--r-- 1 nikos nikos 60571648 Jun =A02 14:59 Monopoly.exe
-rwxr-xr-x 1 nikos nikos =A01788164 Mar 14 11:31 Online\ Movie\ Player.zip*=
-rw-r--r-- 1 nikos nikos =A05277287 Jun =A01 18:35 O\ Nomos\ tou\ Merfy\ v1= -2-3.zip
-rwxr-xr-x 1 nikos nikos 16383001 Jun 22 =A02010 Orthodoxo\ Imerologio.exe*=
-rw-r--r-- 1 nikos nikos =A06084806 Jun =A01 18:22 Pac-Man.exe
-rw-r--r-- 1 nikos nikos 45297713 Jun 10 12:38 Raptor\ Chess.exe
-rw-r--r-- 1 nikos nikos 25476584 Jun =A02 19:50 Scrabble.exe
-rwxr-xr-x 1 nikos nikos 49141166 Mar 17 12:48 To\ 1o\ mou\ vivlio\ gia\ to= \ skaki.pdf*
-rwxr-xr-x 1 nikos nikos =A03298310 Mar 17 12:45 Vivlos\ gia\ Atheofovous.p= df*
-rw-r--r-- 1 nikos nikos =A01764864 May 29 21:50 V-Radio\ v2.4.msi
-rw-r--r-- 1 nikos nikos =A03511233 Jun =A04 14:11 =C5=F5=F7=DE\ =F4=EF=F5\= =C9=E7=F3=EF=FD.mp3
-rwxr-xr-x 1 nikos nikos 66896732 Mar 17 13:13 =CA=EF=F3=EC=DC=F2\ =C1=E9= =F4=F9=EB=FC=F2\ -\ =D0=F1=EF=F6=E7=F4=E5=DF=E5=F2.pdf*
-rw-r--r-- 1 nikos nikos =A0 236032 Jun =A04 14:10 =D3=EA=DD=F8=EF=F5\ =DD= =ED=E1=ED\ =E1=F1=E9=E8=EC=FC.exe


The code is as follows:

# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
# Convert wrongly encoded filenames to utf-8
# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
path =3D b'/home/nikos/public_html/data/apps/'
filenames =3D os.listdir( path )

utf8_filenames =3D []

for filename in filenames:
=A0 =A0 =A0 =A0 # Compute 'path/to/filename'
=A0 =A0 =A0 =A0 filename_bytes =3D path + filename
=A0 =A0 =A0 =A0 encoding =3D guess_encoding( filename_bytes )
=A0 =A0 =A0 =A0
=A0 =A0 =A0 =A0 if encoding =3D=3D 'utf-8':
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # File name is valid UTF-8, so we can skip = to the next file.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 utf8_filenames.append( filename_bytes )
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue
=A0 =A0 =A0 =A0 elif encoding is None:
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # No idea what the encoding is. Hit it with= a hammer until it stops moving.
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 filename =3D filename_bytes.decode( 'ut= f-8', 'xmlcharrefreplace' )
=A0 =A0 =A0 =A0 else:
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 filename =3D filename_bytes.decode( encodin= g )

=A0 =A0 =A0 =A0 # Rename the file to something which ought to be UTF-8 clea= n.
=A0 =A0 =A0 =A0 newname_bytes =3D filename.encode('utf-8')
=A0 =A0 =A0 =A0 os.rename( filename_bytes, newname_bytes )
=A0 =A0 =A0 =A0 utf8_filenames.append( newname_bytes )
=A0 =A0 =A0 =A0
=A0 =A0 =A0 =A0 # Once we get here, the file ought to be UTF-8 clean and th= e Unicode name ought to exist:
=A0 =A0 =A0 =A0 assert os.path.exists( newname_bytes.decode('utf-8'= ) )


# Switch filenames from utf8 bytestrings =3D> unicode strings
filenames =3D []

for utf8_filename in utf8_filenames:
=A0 =A0 =A0 =A0 filenames.append( utf8_filename.decode('utf-8') )
# Check the presence of a database file against the dir files and delete re= cord if it doesn't exist
cur.execute('''SELECT url FROM files''')
data =3D cur.fetchall()

for url in data:
=A0 =A0 =A0 =A0 if url not in filenames:
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 # Delete spurious
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 cur.execute('''DELETE FROM file= s WHERE url =3D %s''', url )


# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
# Display ALL files, each with its own download button
# =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
print('''<body background=3D'/data/images/star.jp= g'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<center><img src=3D'/data/i= mages/download.gif'><br><br>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<table border=3D5 cellpadding=3D5 bgc= olor=3Dgreen>
''')

try:
=A0 =A0 =A0 =A0 cur.execute( '''SELECT * FROM files ORDER BY la= stvisit DESC''' )
=A0 =A0 =A0 =A0 data =3D cur.fetchall()
=A0 =A0 =A0 =A0
=A0 =A0 =A0 =A0 for row in data:
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (filename, hits, host, lastvisit) =3D row =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lastvisit =3D lastvisit.strftime('%A %e= %b, %H:%M')
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 print('''
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <form method=3D"get" action=3D= "/cgi-bin/files.py">
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <tr>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <td> = <center> <input type=3D"submit" name=3D"filename&qu= ot; value=3D"%s"> </td>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <td> = <center> <font color=3Dyellow size=3D5> %s </td>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <td> = <center> <font color=3Dorange size=3D4> %s </td>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 <td> = <center> <font color=3Dsilver size=3D4> %s </td>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </tr>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 </form>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ''' % (filename, hits, host, la= stvisit) )
=A0 =A0 =A0 =A0 print( '''</table><br><br>= 9;'' )
except pymysql.ProgrammingError as e:
=A0 =A0 =A0 =A0 print( repr(e) )

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
PLEASE take a look, its not a huge code, the encoding was of Steven idea= 9;s, so from another thread is a bit more or less already known to the most= of you.

I just want to know why it doesn't print anything.

Thank you and please whoever does not feel like helping, please at least no= t spam the thread.

--
What is now proved was at first only imagined!
--
http://mail.python.org/mailman/listinfo/python-list

--089e0158bfde972e0504df36a1f0--