Re: python 3.44 float addition bug?

2014-06-26 Thread Chris Angelico
On Fri, Jun 27, 2014 at 12:51 PM, Steven D'Aprano wrote: > Although you seem to have missed the critical issue: this is a failure > mode which *binary floats cannot exhibit*, but decimal floats can. The > failure being that > > assert x <= (x+y)/2 <= y > > may fail if x and y are base 10 floats.

Re: print statements and profiling a function slowed performance

2014-06-26 Thread Chris Angelico
On Fri, Jun 27, 2014 at 12:55 PM, Steven D'Aprano wrote: > On Thu, 26 Jun 2014 13:37:41 -0700, CM wrote: > >> On Thursday, June 26, 2014 3:27:48 PM UTC-4, Mark Lawrence wrote: >> >>> 3. use the logging module :) >> >> I've just never got around to it, but I guess I should. Thanks for the >> nudge

Re: print statements and profiling a function slowed performance

2014-06-26 Thread Steven D'Aprano
On Thu, 26 Jun 2014 13:37:41 -0700, CM wrote: > On Thursday, June 26, 2014 3:27:48 PM UTC-4, Mark Lawrence wrote: > >> 3. use the logging module :) > > I've just never got around to it, but I guess I should. Thanks for the > nudge. While using the logging module is recommended for logging, if

Re: python 3.44 float addition bug?

2014-06-26 Thread Steven D'Aprano
On Thu, 26 Jun 2014 19:38:45 +1000, Chris Angelico wrote: > On Thu, Jun 26, 2014 at 7:15 PM, Steven D'Aprano > wrote: >> Here's an error that *cannot* occur with binary floats: the average of >> two numbers x and y is not guaranteed to lie between x and y! >> >> >> py> from decimal import * >> py

Re: Newbie coding question

2014-06-26 Thread Chris Angelico
On Fri, Jun 27, 2014 at 4:53 AM, Martin S wrote: > I've been following the tutorial here > http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ Be aware that this tutorial is aimed at Python 3.1, which is a quite old version in the 3.x branch. I recommend you get the latest Python (currently 3.

Re: print statements and profiling a function slowed performance

2014-06-26 Thread Chris Angelico
On Fri, Jun 27, 2014 at 6:36 AM, CM wrote: >> Yes, it stands to reason that profiling code >> is going to introduce a runtime cost. How else >> would we expect profiling to work? > > I think I was hoping for magic. :D Thank you for being honest :) The fact is, though, that time-of-day and consol

Re: print statements and profiling a function slowed performance

2014-06-26 Thread Michael Torrie
On 06/26/2014 02:36 PM, CM wrote: >> What I do find Heisenbergian are bugs that show >> up when debugging and profiling stuff are removed, >> but completely gone when present. IE profiling and >> debugging slow it down enough that often subtle race >> conditions are masked. > > Would never ha

Re: Execute a python script with CGI ?

2014-06-26 Thread Ian Kelly
On Thu, Jun 26, 2014 at 9:24 AM, dandrigo wrote: > Dear all, > > I coded a python script (web service with query postgresql/postgis). Up to > now, i did several test on my local laptop station (windows). > > Now i want to execute this python script on our remote server (Web server : > Apache;OS :

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-06-26 Thread Ned Deily
In article , Christian Gollwitzer wrote: > Am 26.06.14 14:37, schrieb Christian Gollwitzer: > > Am 26.06.14 12:39, schrieb Peter Tomcsanyi: > >> "Christian Gollwitzer" wrote in message > >> news:lofciv$nq6$1...@dont-email.me... > >>> For PNG image support you can load either the Img package whi

Re: 2.7.7 Built-in OpenSSL Library?

2014-06-26 Thread David Andrzejewski
On Thursday, June 26, 2014 5:09:10 PM UTC-4, Zachary Ware wrote: > On Thu, Jun 26, 2014 at 3:41 PM, David Andrzejewski > > wrote: > > > Taking a look at: > > > > > > http://bugs.python.org/issue21462 > > > > > > It looks like the OpenSSL library in Python 2.7.7 on Windows should be > > 1.0.

Re: 2.7.7 Built-in OpenSSL Library?

2014-06-26 Thread Zachary Ware
On Thu, Jun 26, 2014 at 3:41 PM, David Andrzejewski wrote: > Taking a look at: > > http://bugs.python.org/issue21462 > > It looks like the OpenSSL library in Python 2.7.7 on Windows should be 1.0.1. > > However, when I install Python 2.7.7 on my system, > > > C:\Python27>python > Python 2.7.7 (def

2.7.7 Built-in OpenSSL Library?

2014-06-26 Thread David Andrzejewski
Taking a look at: http://bugs.python.org/issue21462 It looks like the OpenSSL library in Python 2.7.7 on Windows should be 1.0.1. However, when I install Python 2.7.7 on my system, C:\Python27>python Python 2.7.7 (default, Jun 1 2014, 14:17:13) [MSC v.1500 32 bit (Intel)] on win32 Type "help

Re: print statements and profiling a function slowed performance

2014-06-26 Thread CM
On Thursday, June 26, 2014 3:27:48 PM UTC-4, Mark Lawrence wrote: > 3. use the logging module :) I've just never got around to it, but I guess I should. Thanks for the nudge. -- https://mail.python.org/mailman/listinfo/python-list

Re: print statements and profiling a function slowed performance

2014-06-26 Thread CM
> Seems like over the years good old fashioned > debugging skills have been lost. In the earliest > days of IDEs (Turbo BASIC and QuickBASIC) I > regularly would employ debuggers with break > points, watches, and step through my code. I do also use a debugger, but lazily use print stateme

Re: Newbie coding question

2014-06-26 Thread Emile van Sebille
On 6/26/2014 11:53 AM, Martin S wrote: Hi, I've been following the tutorial here http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ But when I get to section 1.10 there is person = input('Enter your name:') However this generates an error >>> person = input('Enter your name: ') Enter

Re: Newbie coding question

2014-06-26 Thread Martin S
Ah, that was actually correct. Thanks ... /Martin S 2014-06-26 20:58 GMT+02:00 alister : > On Thu, 26 Jun 2014 20:53:35 +0200, Martin S wrote: > > > Hi, > > > > I've been following the tutorial here > > http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ > > But when I get to section 1.10 th

Re: print statements and profiling a function slowed performance

2014-06-26 Thread Mark Lawrence
On 26/06/2014 19:44, CM wrote: Huh. I learned two new Python facts this week: 1. print statements were slowing down my code enough to really notice a particular transition. It went from about 2-3 seconds to a bit under 1 second. What at first seemed unresponsive now seems almost snappy. The only

Re: print statements and profiling a function slowed performance

2014-06-26 Thread Michael Torrie
On 06/26/2014 12:44 PM, CM wrote: > Huh. I learned two new Python facts this week: > > 1. print statements were slowing down my code enough to > really notice a particular transition. It went from about > 2-3 seconds to a bit under 1 second. What at first seemed > unresponsive now seems almost sna

Re: Newbie coding question

2014-06-26 Thread alister
On Thu, 26 Jun 2014 20:53:35 +0200, Martin S wrote: > Hi, > > I've been following the tutorial here > http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ > But when I get to section 1.10 there is > > person = input('Enter your name: ') > > However this generates an error > > person =

Re: OOP no Python

2014-06-26 Thread Guilherme Rezende
Samuel, http://groups.google.com/group/python-brasil On Thu, Jun 26, 2014 at 12:18 PM, Chris Angelico wrote: > 2014-06-27 0:16 GMT+10:00 Samuel David : > > Mas estou com uma dúvida referente ao tópico “Por que eu deveria usar > Python > > e não ?”. > > Google Translate tells me you're asking "

Newbie coding question

2014-06-26 Thread Martin S
Hi, I've been following the tutorial here http://anh.cs.luc.edu/python/hands-on/3.1/handsonHtml/ But when I get to section 1.10 there is person = input('Enter your name: ') However this generates an error >>> person = input('Enter your name: ') Enter your name: hi Traceback (most recent call

print statements and profiling a function slowed performance

2014-06-26 Thread CM
Huh. I learned two new Python facts this week: 1. print statements were slowing down my code enough to really notice a particular transition. It went from about 2-3 seconds to a bit under 1 second. What at first seemed unresponsive now seems almost snappy. The only difference was removing a lot of

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-06-26 Thread Christian Gollwitzer
Am 26.06.14 14:37, schrieb Christian Gollwitzer: Am 26.06.14 12:39, schrieb Peter Tomcsanyi: "Christian Gollwitzer" wrote in message news:lofciv$nq6$1...@dont-email.me... For PNG image support you can load either the Img package which gives support for a large variety of images, or the smaller

Re: State of speeding up Python for full applications

2014-06-26 Thread Mark Lawrence
On 26/06/2014 17:49, CM wrote: I'm reposting my question with, I hope, better formatting: I occasionally hear about performance improvements for Python by various projects like psyco (now old), ShedSkin, Cython, PyPy, Nuitka, Numba, and probably many others. The benchmarks are out there, and t

Re: State of speeding up Python for full applications

2014-06-26 Thread CM
I'm reposting my question with, I hope, better formatting: I occasionally hear about performance improvements for Python by various projects like psyco (now old), ShedSkin, Cython, PyPy, Nuitka, Numba, and probably many others. The benchmarks are out there, and they do make a difference,

Re: Execute a python script with CGI ?

2014-06-26 Thread gregor
Hi, Am Thu, 26 Jun 2014 08:24:56 -0700 (PDT) schrieb dandrigo : > I coded a python script (web service with query postgresql/postgis). > Up to now, i did several test on my local laptop station (windows). > > Now i want to execute this python script on our remote server (Web > server : Apache;O

Execute a python script with CGI ?

2014-06-26 Thread dandrigo
Dear all, I coded a python script (web service with query postgresql/postgis). Up to now, i did several test on my local laptop station (windows). Now i want to execute this python script on our remote server (Web server : Apache;OS : Linux). How to write a CGI template please? Could you t

Re: OOP no Python

2014-06-26 Thread Chris Angelico
2014-06-27 0:16 GMT+10:00 Samuel David : > Mas estou com uma dúvida referente ao tópico “Por que eu deveria usar Python > e não ?”. Google Translate tells me you're asking "Why use Python instead of ?". (I'm going to respond only in English, as my Portuguese is basically nil. Sorry.) Well, there a

Re: python-daemon for Python v3

2014-06-26 Thread ryuanerin
2014년 1월 19일 일요일 오후 7시 30분 27초 UTC+9, Asaf Las 님의 말: > Hi Community > > > > Is there ported to Python v3 python-daemon package? > > > > https://pypi.python.org/pypi/python-daemon/ > > > > i am afraid it is not as simple as correction of relative path input > > feature and except clauses

Re: State of speeding up Python for full applications

2014-06-26 Thread alister
On Wed, 25 Jun 2014 20:54:29 -0700, CM wrote: > I occasionally hear about performance improvements for Python by various > projects like psyco (now old), ShedSkin, Cython, PyPy, Nuitka, Numba, > and probably many others. The benchmarks are out there, and they do > make a difference, and sometimes

Re: OOP no Python

2014-06-26 Thread Mark Lawrence
On 26/06/2014 15:16, Samuel David wrote: Olá, python.pt https://www.facebook.com/python.pt IRC freenode #python-pt channel I think :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruse

Re: OOP no Python

2014-06-26 Thread Stéphane Wirtel
In English, Sorry On 26 Jun 2014, at 16:16, Samuel David wrote: Olá, Estou analisando algumas necessidades de nossa empresa e fiquei bastante interessado em resolve-las utilizando Python, lendo o FAQ do site de vcs percebo que está é uma linguagem bastante completa. Mas estou com uma dúv

OOP no Python

2014-06-26 Thread Samuel David
Olá, Estou analisando algumas necessidades de nossa empresa e fiquei bastante interessado em resolve-las utilizando Python, lendo o FAQ do site de vcs percebo que está é uma linguagem bastante completa. Mas estou com uma dúvida referente ao tópico “Por que eu deveria usar Python e não ?”.

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-06-26 Thread Christian Gollwitzer
Am 26.06.14 12:39, schrieb Peter Tomcsanyi: "Christian Gollwitzer" wrote in message news:lofciv$nq6$1...@dont-email.me... For PNG image support you can load either the Img package which gives support for a large variety of images, or the smaller tkpng package. My first Google search for "tkpn

Re: Python 3.4.1 installer on Mac links Python to old Tcl/Tk

2014-06-26 Thread Peter Tomcsanyi
"Christian Gollwitzer" wrote in message news:lofciv$nq6$1...@dont-email.me... For PNG image support you can load either the Img package which gives support for a large variety of images, or the smaller tkpng package. My first Google search for "tkpng" "python" gave no usable results. So I am n

Re: Standard way to generate mail/news reply?

2014-06-26 Thread Adam Funk
On 2014-06-24, Skip Montanaro wrote: > On Tue, Jun 24, 2014 at 6:46 AM, Adam Funk wrote: >> Is there some standard library or code for taking an e-mail or >> newsgroup message & generating a reply to it? > > You might try searching for "mail reply" on pypi.python.org. That will > return a number

Re: protect psycopg script from sql injection?

2014-06-26 Thread Peter Otten
celati Laurent wrote: > I coded this following python script via psycopg; > > web_service_test.py > > > 1/ When i execute it, the result is 'bad resquest'. Could you tell me why? No, but you might find out yourself. When you remo

Re: python 3.44 float addition bug?

2014-06-26 Thread Chris Angelico
On Thu, Jun 26, 2014 at 7:15 PM, Steven D'Aprano wrote: > Here's an error that *cannot* occur with binary floats: the average of > two numbers x and y is not guaranteed to lie between x and y! > > > py> from decimal import * > py> getcontext().prec = 3 > py> x = Decimal('0.516') > py> y = Decimal(

Re: How to get Timezone from latitude/longitude ?

2014-06-26 Thread codetarsier
Thanks for the help people. I was looking for the Malyasia City(lat/long)timezones. -- https://mail.python.org/mailman/listinfo/python-list

Re: python 3.44 float addition bug?

2014-06-26 Thread Steven D'Aprano
On Thu, 26 Jun 2014 13:39:23 +1000, Ben Finney wrote: > Steven D'Aprano writes: > >> On Wed, 25 Jun 2014 14:12:31 -0700, Maciej Dziardziel wrote: >> >> > Floating points values use finite amount of memory, and cannot >> > accurately represent infinite amount of numbers, they are only >> > approx