Re: Printing a drop down menu for a specific field.

2013-10-27 Thread rurpy
On 10/27/2013 01:31 AM, Nick the Gr33k wrote: > Στις 27/10/2013 6:00 πμ, ο/η ru...@yahoo.com έγραψε: >[...] [following quote lightly edited for clarity] > I almost understand your code, but this part is not so clear to me: > key = host, city, useros, browser > if key not in seen: newdata

Re: Printing a drop down menu for a specific field.

2013-10-27 Thread Dave Angel
On 27/10/2013 03:31, Nick the Gr33k wrote: > Στις 27/10/2013 6:00 πμ, ο/η ru...@yahoo.com έγραψε: > > I read it thoroughly and tested it and it works as it should. > > I just wanted to mention that the definition of the function coalesce() > must come prior of: > >> newdata = coal

Re: Printing a drop down menu for a specific field.

2013-10-27 Thread Nick the Gr33k
Στις 27/10/2013 6:00 πμ, ο/η ru...@yahoo.com έγραψε: On 10/26/2013 06:11 PM, Nick the Gr33k wrote: Στις 27/10/2013 2:52 πμ, ο/η Nick the Gr33k έγραψε: Ah foun it had to change in you code this line: key = host, city, useros, browser, ref to this line: key = host, c

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread rurpy
On 10/26/2013 06:11 PM, Nick the Gr33k wrote: > Στις 27/10/2013 2:52 πμ, ο/η Nick the Gr33k έγραψε: >> Ah foun it had to change in you code this line: >> key = host, city, useros, browser, ref >> >> to this line: >> >> key = host, city, useros, browser >> >> so 'ref' would

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread Nick the Gr33k
Στις 27/10/2013 2:52 πμ, ο/η Nick the Gr33k έγραψε: Ah foun it had to change in you code this line: key = host, city, useros, browser, ref to this line: key = host, city, useros, browser so 'ref' wouldnt be calculated in the unique combination key. I'am still trying

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread Nick the Gr33k
Στις 27/10/2013 2:31 πμ, ο/η Nick the Gr33k έγραψε: Στις 26/10/2013 9:33 μμ, ο/η ru...@yahoo.com έγραψε: On 10/20/2013 05:30 PM, Νίκος Αλεξόπουλος wrote: try: cur.execute( '''SELECT host, city, useros, browser, ref, hits, lastvisit FROM visitors WHERE counterID = (SELECT ID FROM counters WH

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread Nick the Gr33k
Στις 26/10/2013 9:33 μμ, ο/η ru...@yahoo.com έγραψε: On 10/20/2013 05:30 PM, Νίκος Αλεξόπουλος wrote: try: cur.execute( '''SELECT host, city, useros, browser, ref, hits, lastvisit FROM visitors WHERE counterID = (SELECT ID FROM counters WHERE url = %s) ORDER BY lastvisit DESC''', page )

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread rurpy
On 10/20/2013 05:30 PM, Νίκος Αλεξόπουλος wrote: > try: > cur.execute( '''SELECT host, city, useros, browser, ref, hits, > lastvisit FROM visitors WHERE counterID = (SELECT ID FROM counters WHERE > url = %s) ORDER BY lastvisit DESC''', page ) > data = cur.fetchall() > >

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread Steven D'Aprano
On Sat, 26 Oct 2013 18:40:52 +0300, Nick the Gr33k wrote: > Can someone write this properly? i tried but cannot make it work. Start by writing down what problem you are trying to solve with this code, and what you expect the code to do. In detail. What input data does it take, what result shoul

Re: Printing a drop down menu for a specific field.

2013-10-26 Thread Nick the Gr33k
Στις 26/10/2013 5:10 μμ, ο/η Nick the Gr33k έγραψε: [QUOTE=turvey]Say your data is like the following: data = [('alice', 1), ('alice', 2), ('bob', 5), ('bob', 10), ('carrie', 3)] Where the first entry is your user and the second entry is a timestamp. Your data is structured basically like this,

Printing a drop down menu for a specific field.

2013-10-26 Thread Nick the Gr33k
[QUOTE=turvey]Say your data is like the following: data = [('alice', 1), ('alice', 2), ('bob', 5), ('bob', 10), ('carrie', 3)] Where the first entry is your user and the second entry is a timestamp. Your data is structured basically like this, except I stripped the irrelevant details. [CODE]

Re: Printing a drop down menu for a specific field.

2013-10-21 Thread Joel Goldstick
On Mon, Oct 21, 2013 at 3:31 AM, Mark Lawrence wrote: > > On 21/10/2013 07:07, Νίκος Αλεξόπουλος wrote: >> >> >> Any help would be appreciated. > > > It is considered polite to wait for at least 24 hours before pinging. If > waiting for this time isn't an option then paying for support is. > > --

Re: Printing a drop down menu for a specific field.

2013-10-21 Thread Νίκος Αλεξόπουλος
Στις 21/10/2013 9:58 πμ, ο/η Steven D'Aprano έγραψε: On Mon, 21 Oct 2013 09:07:17 +0300, Νίκος Αλεξόπουλος wrote: for row in data: (host, city, useros, browser, ref, hits, lastvisit) = row lastvisit = lastvisit.strftime('%A %e %b, %H:%M') print( "" )

Re: Printing a drop down menu for a specific field.

2013-10-21 Thread Mark Lawrence
On 21/10/2013 07:07, Νίκος Αλεξόπουλος wrote: Any help would be appreciated. It is considered polite to wait for at least 24 hours before pinging. If waiting for this time isn't an option then paying for support is. -- Python is the second best programming language in the world. But the bes

Re: Printing a drop down menu for a specific field.

2013-10-21 Thread Steven D'Aprano
On Mon, 21 Oct 2013 09:07:17 +0300, Νίκος Αλεξόπουλος wrote: >> for row in data: >> (host, city, useros, browser, ref, hits, lastvisit) = row >> lastvisit = lastvisit.strftime('%A %e %b, %H:%M') >> >> print( "" ) >> for item in (host, city, useros, browser,

Re: Printing a drop down menu for a specific field.

2013-10-20 Thread Ben Finney
Νίκος Αλεξόπουλος writes: > Any help would be appreciated. Please stop posting merely for grabbing attention. If someone is going to answer, they'll answer. Don't annoy the forum with pleas for attention. -- \“Program testing can be a very effective way to show the | `\

Re: Printing a drop down menu for a specific field.

2013-10-20 Thread Νίκος Αλεξόπουλος
Στις 21/10/2013 2:30 πμ, ο/η Νίκος Αλεξόπουλος έγραψε: try: cur.execute( '''SELECT host, city, useros, browser, ref, hits, lastvisit FROM visitors WHERE counterID = (SELECT ID FROM counters WHERE url = %s) ORDER BY lastvisit DESC''', page ) data = cur.fetchall() for row in data:

Printing a drop down menu for a specific field.

2013-10-20 Thread Νίκος Αλεξόπουλος
try: cur.execute( '''SELECT host, city, useros, browser, ref, hits, lastvisit FROM visitors WHERE counterID = (SELECT ID FROM counters WHERE url = %s) ORDER BY lastvisit DESC''', page ) data = cur.fetchall() for row in data: (host, city, useros,