Re: Formatting a column's value output

2013-02-03 Thread Steven D'Aprano
On Sun, 03 Feb 2013 09:18:42 -0800, Jason Friedman wrote: >> One of the difficulties on this list is that we don't have >> two-dimensional people. Even our worst trolls have some redeeming >> features. I can't just dismiss Ferrous out of hand... > > Indeed, and that is a "problem" with humanity i

Re: Formatting a column's value output

2013-02-03 Thread Jason Friedman
> One of the difficulties on this list is that we don't have > two-dimensional people. Even our worst trolls have some redeeming > features. I can't just dismiss Ferrous out of hand... Indeed, and that is a "problem" with humanity in general. It is proof that God (or the universe) has a sense of h

Re: Formatting a column's value output

2013-01-28 Thread Κώστας Παπαδόπουλος
Τη Δευτέρα, 28 Ιανουαρίου 2013 12:27:12 π.μ. UTC+2, ο χρήστης ru...@yahoo.com έγραψε: > On 01/27/2013 01:50 PM, Mitya Sirenef wrote: > > > On 01/27/2013 03:24 PM, Κώστας Παπαδόπουλος wrote: > > >> Τη Κυριακή, 27 Ιανουαρίου 2013 9:12:16 μ.μ. UTC+2, ο χρήστης > >> ru...@yahoo.com έγραψε: > > >

Re: Formatting a column's value output

2013-01-28 Thread Κώστας Παπαδόπουλος
Τη Κυριακή, 27 Ιανουαρίου 2013 10:50:33 μ.μ. UTC+2, ο χρήστης Mitya Sirenef έγραψε: > On 01/27/2013 03:24 PM, οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ > οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ wrote: > > > οΏ½οΏ½ οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½, 27 οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½ 2013 > > 9:12:16 οΏ½.οΏ½. UTC+2, οΏ½ οΏ½οΏ½οΏ½οΏ½

Re: Formatting a column's value output

2013-01-27 Thread rurpy
On 01/27/2013 01:50 PM, Mitya Sirenef wrote: > On 01/27/2013 03:24 PM, Κώστας Παπαδόπουλος wrote: >> Τη Κυριακή, 27 Ιανουαρίου 2013 9:12:16 μ.μ. UTC+2, ο χρήστης >> ru...@yahoo.com έγραψε: > >> > > > > Yes indeed, there is no need to use a loop since i know the exact > number of items i'am e

Re: Formatting a column's value output

2013-01-27 Thread Mitya Sirenef
On 01/27/2013 03:24 PM, Κώστας Παπαδόπουλος wrote: Τη Κυριακή, 27 Ιανουαρίου 2013 9:12:16 μ.μ. UTC+2, ο χρήστης ru...@yahoo.com έγραψε: >> > > Yes indeed, there is no need to use a loop since i know the exact number of items i'am expecting. Thanks you very much for clarifying this to me: >

Re: Formatting a column's value output

2013-01-27 Thread Κώστας Παπαδόπουλος
Τη Κυριακή, 27 Ιανουαρίου 2013 9:12:16 μ.μ. UTC+2, ο χρήστης ru...@yahoo.com έγραψε: > Yes indeed, there is no need to use a loop since i know the exact number of items i'am expecting. Thanks you very much for clarifying this to me: One last thing i want to ask you: ===

Re: Formatting a column's value output

2013-01-27 Thread rurpy
On 01/27/2013 11:44 AM, Κώστας Παπαδόπουλος wrote: > This is not correct. > the attribute is for url (row[0]) only, not for url and hits too. > > i want the following working code: > > = > data = cur.fetchall() > for row in data: > ur

Re: Formatting a column's value output

2013-01-27 Thread Κώστας Παπαδόπουλος
Τη Κυριακή, 27 Ιανουαρίου 2013 8:36:42 μ.μ. UTC+2, ο χρήστης Joel Goldstick έγραψε: > On Sun, Jan 27, 2013 at 1:05 PM, Κώστας Παπαδόπουλος > wrote: > > Τη Κυριακή, 27 Ιανουαρίου 2013 6:12:59 μ.μ. UTC+2, ο χρήστης ru...@yahoo.com > έγραψε: > > > > > > On 01/27/2013 02:04 AM, Ferrous Cranus

Re: Formatting a column's value output

2013-01-27 Thread Joel Goldstick
On Sun, Jan 27, 2013 at 1:05 PM, Κώστας Παπαδόπουλος wrote: > Τη Κυριακή, 27 Ιανουαρίου 2013 6:12:59 μ.μ. UTC+2, ο χρήστης > ru...@yahoo.com έγραψε: > > On 01/27/2013 02:04 AM, Ferrous Cranus wrote: > > > > >[...] > > > > > data = cur.fetchall() > > > > > for row in data: >

Re: Formatting a column's value output

2013-01-27 Thread Κώστας Παπαδόπουλος
Τη Κυριακή, 27 Ιανουαρίου 2013 6:12:59 μ.μ. UTC+2, ο χρήστης ru...@yahoo.com έγραψε: > On 01/27/2013 02:04 AM, Ferrous Cranus wrote: > > >[...] > > > data = cur.fetchall() > > > for row in data: > > > print ( "" ) > > >

Re: Formatting a column's value output

2013-01-27 Thread Virgil Stokes
On 27-Jan-2013 17:12, ru...@yahoo.com wrote: On 01/27/2013 02:04 AM, Ferrous Cranus wrote: [...] data = cur.fetchall() for row in data: print ( "" ) for item in row:

Re: Formatting a column's value output

2013-01-27 Thread rurpy
On 01/27/2013 02:04 AM, Ferrous Cranus wrote: >[...] > data = cur.fetchall() > for row in data: > print ( "" ) > > for item in row: > print( ''' href='http://www.%s

Re: Formatting a column's value output

2013-01-27 Thread Κώστας Παπαδόπουλος
Τη Κυριακή, 27 Ιανουαρίου 2013 11:26:38 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > You have been given a number of hints. Coding requires work, not just > > complaining that someone else's code "is not correct". Either pay > > someone to do the work, or do it yourself, but don't expect and

Re: Formatting a column's value output

2013-01-27 Thread Chris Angelico
On Sun, Jan 27, 2013 at 8:16 PM, Ferrous Cranus wrote: > Τη Κυριακή, 27 Ιανουαρίου 2013 11:08:15 π.μ. UTC+2, ο χρήστης Chris Angelico > έγραψε: >> On Sun, Jan 27, 2013 at 8:04 PM, Ferrous Cranus >> wrote: >> >> > Okey, so far BUT i want the url linking to happen only for the URL >> > column's

Re: Formatting a column's value output

2013-01-27 Thread Ferrous Cranus
Τη Κυριακή, 27 Ιανουαρίου 2013 11:08:15 π.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Sun, Jan 27, 2013 at 8:04 PM, Ferrous Cranus wrote: > > > Okey, so far BUT i want the url linking to happen only for the URL column's > > value, and not for the hits column too. How do i apply the url link

Re: Formatting a column's value output

2013-01-27 Thread Chris Angelico
On Sun, Jan 27, 2013 at 8:04 PM, Ferrous Cranus wrote: > Okey, so far BUT i want the url linking to happen only for the URL column's > value, and not for the hits column too. How do i apply the url link to the > URL column's value only? Step 1: Learn to read documentation. Step 2: Learn to writ

Re: Formatting a column's value output

2013-01-27 Thread Ferrous Cranus
Τη Κυριακή, 27 Ιανουαρίου 2013 12:26:44 π.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > A tuple is one method for passing variables into the string formatter. > > So if you need to display something twice, just put in two "%s" in the > > format string, and pass it the same variable twice. Yes i

Re: Formatting a column's value output

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 10:29 AM, alex23 wrote: > 5) Please stop writing code for his _commercial web hosting service_ > for free. You mean, stop asking us to write &c.? With that edit, yes, I agree. One of the difficulties on this list is that we don't have two-dimensional people. Even our wors

Re: Formatting a column's value output

2013-01-26 Thread alex23
On Jan 27, 8:18 am, Chris Angelico wrote: > 1) Trim your quotes. I can't be bothered doing your trimming for you, > so I'm now under-quoting. > > 2) Quit using Google Groups, or manually fix its brain-dead double-spacing. > > 3) Look into Python's formatting options and see how to solve your own >

Re: Formatting a column's value output

2013-01-26 Thread Michael Torrie
On 01/26/2013 12:41 PM, Ferrous Cranus wrote: > I can use triple (''') quoting so i dont have to escape special characters. Hmm. I think you missed what he was getting at. He's not talking about Python escape sequences. He's talking about HTML ones. There is a function in one of the standard lib

Re: Formatting a column's value output

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 8:07 AM, Ferrous Cranus wrote: > That code works, but it creates links for both the URL and hits columns! > Only the URL must be linked not the hits column! 1) Trim your quotes. I can't be bothered doing your trimming for you, so I'm now under-quoting. 2) Quit using Googl

Re: Formatting a column's value output

2013-01-26 Thread Ferrous Cranus
Τη Σάββατο, 26 Ιανουαρίου 2013 8:04:12 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Sun, Jan 27, 2013 at 4:51 AM, Ferrous Cranus wrote: > > > print ( " %s > > " % item ) > > > > > > > > In the aboce code wheb 'URL' is to be typed out be print i need it t

Re: Formatting a column's value output

2013-01-26 Thread Ferrous Cranus
Τη Σάββατο, 26 Ιανουαρίου 2013 8:04:12 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > On Sun, Jan 27, 2013 at 4:51 AM, Ferrous Cranus wrote: > > > print ( " %s > > " % item ) > > > > > > > > In the aboce code wheb 'URL' is to be typed out be print i need it t

Re: Formatting a column's value output

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 4:51 AM, Ferrous Cranus wrote: > print ( " %s " > % item ) > > In the aboce code wheb 'URL' is to be typed out be print i need it to be > formatted as a link, so the viewer can click on it. > > Is this possible please? Easy, just make a t

Formatting a column's value output

2013-01-26 Thread Ferrous Cranus
try: cur.execute( '''SELECT URL, hits FROM counters ORDER BY hits DESC''' ) except MySQLdb.Error, e: print ( "Query Error: ", sys.exc_info()[1].excepinfo()[2] ) else: data = cur.fetchall() for