Re: Cancel threads after timeout

2013-01-26 Thread dieter
hyperboreean writes: > Here's the use case I want to implement - I have to generate a report > from multiple database servers. This report should be generated every 2 > hours. Sometimes it happens that a query on one of the database servers > takes longer than expected and impedes the generation

Re: ??????????? DOES GOG EXIST

2013-01-26 Thread Frank Millman
On 26/01/2013 18:41, BV BV wrote: DOES GOG EXIST http://www.youtube.com/watch?v=tRMmTbCXXAk&feature=related THANK YOU Did you hear about the dyslexic agnostic insomniac? He lies awake at night wondering if there is a dog. -- http://mail.python.org/mailman/listinfo/python-list

Re: The utter mess of current timezone definitions (was: Comparing offset-aware and offset-naive datetimes?)

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 4:25 PM, Ben Finney wrote: >> but I happen to know its offset is 0 (i.e. GMT). > > As further fuel for your hatred: GMT is not the same thing as UTC+0, and > never has been. (See the definitions of those two separate timezones for > more; Wikipedia's articles are probably a

The utter mess of current timezone definitions (was: Comparing offset-aware and offset-naive datetimes?)

2013-01-26 Thread Ben Finney
Roy Smith writes: > but I happen to know its offset is 0 (i.e. GMT). As further fuel for your hatred: GMT is not the same thing as UTC+0, and never has been. (See the definitions of those two separate timezones for more; Wikipedia's articles are probably a good start.) > May the flies of a thou

Re: Comparing offset-aware and offset-naive datetimes?

2013-01-26 Thread Ben Finney
Roy Smith writes: > I have two datetimes. One is offset-naive. The other is offset-aware, > but I happen to know its offset is 0 (i.e. GMT). Do you know the timezone of the offset-naive value? Or is the above mixed up, and you mean “one is offset-aware; the other is offset-naive, but I happe

Re: Comparing offset-aware and offset-naive datetimes?

2013-01-26 Thread Vito De Tullio
Roy Smith wrote: > I have two datetimes. One is offset-naive. The other is offset-aware, > but I happen to know its offset is 0 (i.e. GMT). How can I compare > these? http://pytz.sourceforge.net/#localized-times-and-date-arithmetic -- ZeD -- http://mail.python.org/mailman/listinfo/python-l

Re: doctests/unittest problem with exception

2013-01-26 Thread Steven D'Aprano
Paul wrote: > Hello. I converted doctests into DocTestSuite() to use with unittest. And > try it under Python 3. > > And, sure, I get errors with unmatched exceptions details (mismatched name > of exception class: a.b.c.MyError instead of MyError). So, I have 2 > questions: > > 1) how to turn on

Comparing offset-aware and offset-naive datetimes?

2013-01-26 Thread Roy Smith
I have two datetimes. One is offset-naive. The other is offset-aware, but I happen to know its offset is 0 (i.e. GMT). How can I compare these? May the flies of a thousand Norwegian Blue parrots infest the armpits of whoever invented timezones. -- http://mail.python.org/mailman/listinfo/pyt

Re: Cancel threads after timeout

2013-01-26 Thread Cameron Simpson
On 26Jan2013 09:48, Matt Jones wrote: | It sounds like your real problem is with your SQL query... Is that part of | this problem under your control? Can you break the query into smaller, | quicker, pieces that you can run in a reasonable amount of time? Another option to investigate is whether

Re: Ctypes can't find libc on Solaris

2013-01-26 Thread Skip Montanaro
> After worming around distutils' inability to use > environment variables to add command line flags to gcc, I'm stuck with > an error trying to locate libc: ... Should have poked around bugs.python.org first. This was reported, with a patch that works for me: http://bugs.python.org/issue528

Re: Python Programming - 28 hours training in New York for $3999

2013-01-26 Thread Juhani Karlsson
Hah yeah! 8e is normal price here in Finland. : ) On 27 January 2013 01:57, Chris Angelico wrote: > On Sun, Jan 27, 2013 at 3:38 AM, Juhani Karlsson > wrote: > > Or take this course for free and buy 500 lunches. > > Your choice. > > You spend $8 on lunch? Wow, that's taking TANSTAAFL a long way

Ctypes can't find libc on Solaris

2013-01-26 Thread Skip Montanaro
I'm trying to build PyPy on a Solaris 10 system (not supported by the PyPy gang). After worming around distutils' inability to use environment variables to add command line flags to gcc, I'm stuck with an error trying to locate libc: [translation:ERROR] Error: [translation:ERROR] Traceback (most

Re: Python Programming - 28 hours training in New York for $3999

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 3:38 AM, Juhani Karlsson wrote: > Or take this course for free and buy 500 lunches. > Your choice. You spend $8 on lunch? Wow, that's taking TANSTAAFL a long way... ChrisA -- http://mail.python.org/mailman/listinfo/python-list

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: Python Programming - 28 hours training in New York for $3999

2013-01-26 Thread Juhani Karlsson
https://www.edx.org/courses/MITx/6.00x/2013_Spring/about Or take this course for free and buy 500 lunches. Your choice. On 26 January 2013 18:12, wrote: > Python Programming - 28 hours training in New York for $3999 > > > Course Outline: http://www.nobleprog.us/python-programming/training-cours

Re: ??????????? DOES GOG EXIST

2013-01-26 Thread alex23
On Jan 27, 2:41 am, BV BV wrote: > DOES GOG EXIST Yes, they've been happily selling non-DRMed games for years now: http://www.gog.com/ Highly recommended. -- http://mail.python.org/mailman/listinfo/python-list

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: looking for advice python

2013-01-26 Thread Dave Angel
On 01/26/2013 05:26 PM, twiztidtr...@gmail.com wrote: Hey I'm new to programming and I have been working on calculating miles per gallon. iv posted below what I have and constructive criticism would be wonderful. Thanks A good post for the python-tutor mailing list. If you want help with a

Re: looking for advice python

2013-01-26 Thread Chris Angelico
On Sun, Jan 27, 2013 at 9:26 AM, wrote: > miles = int(string_miles) > gas = int(string_gas) > > #used to calculate mpg through division > mpg = miles/gas > > print(float(string_miles)) > print(float(string_gas)) > print('Your miles per gallon is', format(mpg,'.2f')) Welcome aboard! You turn you

looking for advice python

2013-01-26 Thread twiztidtrees
Hey I'm new to programming and I have been working on calculating miles per gallon. iv posted below what I have and constructive criticism would be wonderful. Thanks #This is a program used to calculate miles per gallon #variable used to gather miles driven string_miles = input('How many mile

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: word_set [snip enormous subject line]

2013-01-26 Thread Steven D'Aprano
Martin Musatov wrote: > word_set = set() [snip SIXTEEN THOUSAND words copied from a spelling dictionary] If you have a question, please: - ASK THE QUESTION, we cannot read your mind; - don't send us thousands of lines taken straight out of a dictionary, just use the SMALLEST amount of sampl

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: Need Pattern For Logging Into A Website

2013-01-26 Thread Tim Daneliuk
On 01/26/2013 12:53 AM, Michael Torrie wrote: On 01/25/2013 05:15 PM, Tim Daneliuk wrote: Does it handle self-signed SSL certs? No idea. you'd have to try it. OK, thanks for the pointer. -- Tim Daneliuk tun..

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: python: HTTP connections through a proxy server requiring authentication

2013-01-26 Thread sajuptpm
Hi, /etc/squid3/squid.conf --- saju@saju-Inspiron-N5010:~$ cat squid.conf | grep ^[^#] auth_param digest program /usr/lib/squid3/digest_pw_auth -c /etc/squid3/passwords auth_param digest realm saju-Inspiron-N5010 acl manager proto cache_object acl localhost src 12

python: HTTP connections through a proxy server requiring authentication

2013-01-26 Thread sajuptpm
Hi, I followed http://dabase.com/blog/Minimal_squid3_proxy_configuration/ to setup proxy server. I tested my proxy server with firefox with IP:127.0.0.1 and Port:3128 and it working (asking for proxy username and password). But, i could not make http connection through proxy server requiring a

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

Re: sockobj.connect Errno 13 Permission denied

2013-01-26 Thread Albert Hopkins
On Sat, Jan 26, 2013, at 08:52 AM, Joel Goldstick wrote: > On Sat, Jan 26, 2013 at 8:47 AM, Joel Goldstick > wrote: > > > > > > > > > On Sat, Jan 26, 2013 at 6:19 AM, nobody wrote: > > > >> Hi, > >> > >> I have a client program Client.py which has a statement of > >> sockobj.connect(), the port

??????????? DOES GOG EXIST

2013-01-26 Thread BV BV
DOES GOG EXIST http://www.youtube.com/watch?v=tRMmTbCXXAk&feature=related THANK YOU -- http://mail.python.org/mailman/listinfo/python-list

Python Programming - 28 hours training in New York for $3999

2013-01-26 Thread joao . cowperthwaite
Python Programming - 28 hours training in New York for $3999 Course Outline: http://www.nobleprog.us/python-programming/training-course Course Date: 2013-03-05 09:30 - 2013-03-08 16:30 Course Price: $3999 per person, usually $4730 per person Remarks: A complimentary lunch will be provided Venue

Re: Cancel threads after timeout

2013-01-26 Thread Matt Jones
It sounds like your real problem is with your SQL query... Is that part of this problem under your control? Can you break the query into smaller, quicker, pieces that you can run in a reasonable amount of time? If not, nesting threads might be your best programmatic solution. Heed Jason's warni

Re: Cancel threads after timeout

2013-01-26 Thread Jason Friedman
> Sometimes it happens that a query on one of the database servers > takes longer than expected and impedes the generation of this report > (that's right, the queries are ran sequential). What I am trying to > achieve is to parallelize the queries on each database server and to be > able to cancel

Re: sockobj.connect Errno 13 Permission denied

2013-01-26 Thread Joel Goldstick
On Sat, Jan 26, 2013 at 8:47 AM, Joel Goldstick wrote: > > > > On Sat, Jan 26, 2013 at 6:19 AM, nobody wrote: > >> Hi, >> >> I have a client program Client.py which has a statement of >> sockobj.connect(), the port number 6 is used, so no problem from port >> permission. >> >> I am puzzled be

Re: sockobj.connect Errno 13 Permission denied

2013-01-26 Thread Joel Goldstick
On Sat, Jan 26, 2013 at 6:19 AM, nobody wrote: > Hi, > > I have a client program Client.py which has a statement of > sockobj.connect(), the port number 6 is used, so no problem from port > permission. > > I am puzzled because I can run Client.py from command line in my user > account or apac

Cancel threads after timeout

2013-01-26 Thread hyperboreean
Here's the use case I want to implement - I have to generate a report from multiple database servers. This report should be generated every 2 hours. Sometimes it happens that a query on one of the database servers takes longer than expected and impedes the generation of this report (that's right, t

sockobj.connect Errno 13 Permission denied

2013-01-26 Thread nobody
Hi, I have a client program Client.py which has a statement of sockobj.connect(), the port number 6 is used, so no problem from port permission. I am puzzled because I can run Client.py from command line in my user account or apache user account without any problems. But if I run it from

Re: mysql solution

2013-01-26 Thread Ferrous Cranus
Τη Παρασκευή, 25 Ιανουαρίου 2013 11:56:44 μ.μ. UTC+2, ο χρήστης Dennis Lee Bieber έγραψε: = #find the visitor record for the (saved) cID and current host cur.execute('''SELECT * FROM visitors WHERE counterID = %s and host = %s

Re: Retrieving an object from a set

2013-01-26 Thread Peter Otten
Vito De Tullio wrote: > MRAB wrote: > >> It turns out that both S & {x} and {x} & S return {x}, not {y}. > > curious. > > $ python > Python 2.7.3 (default, Jul 3 2012, 19:58:39) > [GCC 4.7.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. x = (1,2,3) >>