Re: for / while else doesn't make sense

2016-05-23 Thread Gregory Ewing
Pete Forman wrote: However I am coming from scientific measurements where 1.0 is the stored value for observations between 0.95 and 1.05. You only know that because you're keeping some extra information in your head about what the 1.0 stored in your computer represents. It's not inherent in the

Re: JNLP File download and run

2016-05-23 Thread Robert Clove
Can u provide the pseudo code for the same On Fri, May 20, 2016 at 9:06 PM, Michael Torrie wrote: > On 05/20/2016 01:30 AM, Robert Clove wrote: > > Hi, > > > > Can someone give me pseudo code to download and JNLP file from a URL and > > run it? > > > > Looks like a advance concept in python > >

Business Apps Developement

2016-05-23 Thread shagun . balla7
With thоuѕаndѕ аnd thousands оf uѕеrѕ аnd еnоrmоuѕ amounts of dоwnlоаdѕ, Andrоid Aррliсаtiоnѕ Dеvеlорmеnt field iѕ humming with асtiоn. More visit. http://www.volivesolutions.com/android-mobile-application-development-company.html";> business apps developement -- https://mail.python.org/mailman

When were real numbers born? (was for / while else doesn't make sense)

2016-05-23 Thread Rustom Mody
On Tuesday, May 24, 2016 at 4:10:59 AM UTC+5:30, Ian wrote: > On Mon, May 23, 2016 at 9:30 AM, Rustom Mody wrote: > > Yes the point is being missed but in a different direction: > > The SET (as a completed whole) of real numbers (ℝ) is no more than a 100 > > years > > old. > > People may have used

Re: for / while else doesn't make sense

2016-05-23 Thread Ned Batchelder
On Monday, May 23, 2016 at 9:06:13 PM UTC-4, Steven D'Aprano wrote: > On Tue, 24 May 2016 08:36 am, Christopher Reimer wrote: > > > Those symbols are blowing my 8-bit ASCII brain. :) > > That's certainly true, because there is no such thing as 8-bit ASCII. ASCII > is a 7-bit encoding. (Most imple

Re: for / while else doesn't make sense

2016-05-23 Thread Steven D'Aprano
On Tue, 24 May 2016 03:09 am, Jon Ribbens wrote: > On 2016-05-23, Steven D'Aprano wrote: >> But one thing is certain: very few people, Jon Ribbens being one of them, >> expects 1/3 to return 0. And that is why Python changed the meaning of >> the / operator: because using it for integer division

Re: for / while else doesn't make sense

2016-05-23 Thread Steven D'Aprano
On Tue, 24 May 2016 08:36 am, Christopher Reimer wrote: > Those symbols are blowing my 8-bit ASCII brain. :) That's certainly true, because there is no such thing as 8-bit ASCII. ASCII is a 7-bit encoding. (Most implementations set the extra bit to zero, a few *very* old machines might have set i

Numerical methods [was Re: for / while else doesn't make sense]

2016-05-23 Thread Steven D'Aprano
On Tue, 24 May 2016 06:17 am, Mark Dickinson signed his post: > (who should probably take a numerical methods class someday) Really? I would have thought you could have taught a numerical methods class. You certainly know more about it than I do, and I have taken one! (Twice!) -- Steven --

Re: for / while else doesn't make sense

2016-05-23 Thread Steven D'Aprano
On Tue, 24 May 2016 04:16 am, Pete Forman wrote: > Something else which I do not think has been stated yet in this thread > is that floating point is an inexact representation. Just because > integers and binary fractions have an exact correspondence we ought not > to be affording them special sig

Re: for / while else doesn't make sense

2016-05-23 Thread Chris Angelico
On Tue, May 24, 2016 at 10:07 AM, Dennis Lee Bieber wrote: > Now... Figuring out how many pfennig to charge for that half wheel... > THAT requires number crunching Nah, you just take the number of pfennig you would have charged, and charge that many halbpfennig instead. At least, that's

Re: [pyinotify] help required to send only one mail for chunk of events

2016-05-23 Thread Chris Angelico
On Tue, May 24, 2016 at 6:20 AM, Mohan L wrote: > I wanted to send an email notification with content of logfile after 15 > mins on any change. The idea is I want to send only one mail for chunk of > events.Say for example, I want to send only one email when some one extract > a tar.gz file in wat

Re: for / while else doesn't make sense

2016-05-23 Thread Alan Evangelista
On 05/23/2016 02:52 PM, Ian Kelly wrote: On Mon, May 23, 2016 at 11:44 AM, Random832 wrote: On Mon, May 23, 2016, at 13:33, Chris Angelico wrote: and then you can use the special "tagged literal" syntax, like with special forms of string literal: f*22/7 + f*2/11 Fraction(256, 77) I like t

Re: for / while else doesn't make sense

2016-05-23 Thread Christopher Reimer
> On May 23, 2016, at 1:22 PM, Grant Edwards wrote: > >> On 2016-05-23, Ian Kelly wrote: >>> On Mon, May 23, 2016 at 9:53 AM, Ian Kelly wrote: >>> I'm not sure where ℝ comes into this in the first place. Existing >>> Python numeric types only represent various subsets of ℚ (in the case >>> of f

Re: numpy problem

2016-05-23 Thread Michael Selik
On Mon, May 23, 2016 at 9:12 AM wrote: > > On 23 mei 2016, at 14:19, Peter Otten <__pete...@web.de> wrote: > > li...@onemanifest.net wrote: > > > >> I've got a 2D array > >> And an array of indexes that for shows which row to keep for each column > >> of values: > >> > >> keep = np.array([2, 3, 1

Re: for / while else doesn't make sense

2016-05-23 Thread Ian Kelly
On Mon, May 23, 2016 at 9:30 AM, Rustom Mody wrote: > Yes the point is being missed but in a different direction: > The SET (as a completed whole) of real numbers (ℝ) is no more than a 100 years > old. > People may have used fractions earlier > > And even here the first line of Steven's http://nri

Re: for / while else doesn't make sense

2016-05-23 Thread Pete Forman
Ian Kelly writes: > On Mon, May 23, 2016 at 12:16 PM, Pete Forman wrote: >> Something else which I do not think has been stated yet in this >> thread is that floating point is an inexact representation. Just >> because integers and binary fractions have an exact correspondence we >> ought not to

Re: for / while else doesn't make sense

2016-05-23 Thread Ben Bacarisse
Mark Dickinson writes: > Ben Bacarisse bsb.me.uk> writes: >> [1] Not being a Python expert I don't know how you show that actual >> value of a float. What is the Pythonic way to do that? > > I don't know about Pythonic, but here are some options. > > 1. Convert the float to Decimal, and print t

Re: for / while else doesn't make sense

2016-05-23 Thread Grant Edwards
On 2016-05-23, Ian Kelly wrote: > On Mon, May 23, 2016 at 9:53 AM, Ian Kelly wrote: >> I'm not sure where ℝ comes into this in the first place. Existing >> Python numeric types only represent various subsets of ℚ (in the case >> of fractions.Fraction, the entirety of ℚ). > > And of course I reali

[pyinotify] help required to send only one mail for chunk of events

2016-05-23 Thread Mohan L
Hi All, I am using the bellow script to watch directories. Using 20 seconds to aggregate together a larger chunk of events and enabled coalescing of events. I wanted to send an email notification with content of logfile after 15 mins on any change. The idea is I want to send only one mail for ch

Re: for / while else doesn't make sense

2016-05-23 Thread Mark Dickinson
Ben Bacarisse bsb.me.uk> writes: > [1] Not being a Python expert I don't know how you show that actual > value of a float. What is the Pythonic way to do that? I don't know about Pythonic, but here are some options. 1. Convert the float to Decimal, and print the result. This shows the exact

Re: for / while else doesn't make sense

2016-05-23 Thread Ben Bacarisse
Chris Angelico writes: > On Tue, May 24, 2016 at 2:51 AM, Ben Bacarisse wrote: >> Chris Angelico writes: >> >>> On Tue, May 24, 2016 at 12:29 AM, Ben Bacarisse >>> wrote: Right, but this is to miss the point. Let's say that 4000 years have defined 1/3 to be one third, but Python 3

Re: for / while else doesn't make sense

2016-05-23 Thread Ben Bacarisse
Steven D'Aprano writes: > On Tue, 24 May 2016 12:29 am, Ben Bacarisse wrote: > >> Ian Kelly writes: >> >>> On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano >>> wrote: Are you saying that the Egyptians, Babylonians and Greeks didn't know how to work with fractions? http://ma

Re: for / while else doesn't make sense

2016-05-23 Thread Ian Kelly
On Mon, May 23, 2016 at 12:16 PM, Pete Forman wrote: > Something else which I do not think has been stated yet in this thread > is that floating point is an inexact representation. Just because > integers and binary fractions have an exact correspondence we ought not > to be affording them special

Re: for / while else doesn't make sense

2016-05-23 Thread Pete Forman
Ian Kelly writes: > On Mon, May 23, 2016 at 8:29 AM, Ben Bacarisse wrote: >> Ian Kelly writes: >> >>> On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano >>> wrote: Are you saying that the Egyptians, Babylonians and Greeks didn't know how to work with fractions? http://mathwor

Re: for / while else doesn't make sense

2016-05-23 Thread Chris Angelico
On Tue, May 24, 2016 at 3:57 AM, Jon Ribbens wrote: > On 2016-05-23, Chris Angelico wrote: >> On Tue, May 24, 2016 at 3:09 AM, Jon Ribbens >> wrote: >>> On 2016-05-23, Steven D'Aprano wrote: But one thing is certain: very few people, Jon Ribbens being one of them, expects 1/3 to return

Re: for / while else doesn't make sense

2016-05-23 Thread Jon Ribbens
On 2016-05-23, Chris Angelico wrote: > On Tue, May 24, 2016 at 3:09 AM, Jon Ribbens > wrote: >> On 2016-05-23, Steven D'Aprano wrote: >>> But one thing is certain: very few people, Jon Ribbens being one of them, >>> expects 1/3 to return 0. And that is why Python changed the meaning of >>> the /

Re: RFC: name for project of a cross version disassembler, and unmarshal program

2016-05-23 Thread Pete Forman
Rustom Mody writes: > On Monday, May 23, 2016 at 1:38:41 PM UTC+5:30, rocky wrote: >> On Monday, May 23, 2016 at 2:17:07 AM UTC-4, Pete Forman wrote: >> > rocky writes: >> > >> > > I'm looking for a good name for a relatively new project I'll put >> > > on pypy. >> > > >> > > I've been working o

Re: for / while else doesn't make sense

2016-05-23 Thread Ian Kelly
On Mon, May 23, 2016 at 11:44 AM, Random832 wrote: > On Mon, May 23, 2016, at 13:33, Chris Angelico wrote: >> and then you can use the special "tagged literal" syntax, like with >> special forms of string literal: >> >> >>> f*22/7 + f*2/11 >> Fraction(256, 77) > > I like the infix fraction literal

Re: for / while else doesn't make sense

2016-05-23 Thread Random832
On Mon, May 23, 2016, at 13:33, Chris Angelico wrote: > and then you can use the special "tagged literal" syntax, like with > special forms of string literal: > > >>> f*22/7 + f*2/11 > Fraction(256, 77) I like the infix fraction literal syntax better: 22/f/7 + 2/f/11. -- https://mail.python.org/

Re: for / while else doesn't make sense

2016-05-23 Thread Chris Angelico
On Tue, May 24, 2016 at 3:09 AM, Jon Ribbens wrote: > On 2016-05-23, Steven D'Aprano wrote: >> But one thing is certain: very few people, Jon Ribbens being one of them, >> expects 1/3 to return 0. And that is why Python changed the meaning of >> the / operator: because using it for integer divisi

Re: for / while else doesn't make sense

2016-05-23 Thread Jon Ribbens
On 2016-05-23, Steven D'Aprano wrote: > But one thing is certain: very few people, Jon Ribbens being one of them, > expects 1/3 to return 0. And that is why Python changed the meaning of > the / operator: because using it for integer division was deeply unpopular > and a bug magnet. Making it ret

Re: str(float) python 3 versus 2.7

2016-05-23 Thread Ian Kelly
On Mon, May 23, 2016 at 10:39 AM, Robin Becker wrote: > I had always imagined that the str founction did some kind of rounding on > floats to prevent small numerical errors from showing up. The 2.7 > documentation starts like this > >> class str(object='') >> Return a string containing a nicely pr

Re: for / while else doesn't make sense

2016-05-23 Thread Steven D'Aprano
On Tue, 24 May 2016 12:29 am, Ben Bacarisse wrote: > Ian Kelly writes: > >> On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano >> wrote: >>> Are you saying that the Egyptians, Babylonians and Greeks didn't know >>> how to work with fractions? >>> >>> http://mathworld.wolfram.com/EgyptianFraction.

Re: for / while else doesn't make sense

2016-05-23 Thread Chris Angelico
On Tue, May 24, 2016 at 2:51 AM, Ben Bacarisse wrote: > Chris Angelico writes: > >> On Tue, May 24, 2016 at 12:29 AM, Ben Bacarisse wrote: >>> Right, but this is to miss the point. Let's say that 4000 years have >>> defined 1/3 to be one third, but Python 3 (as do many programming >>> languages

Re: for / while else doesn't make sense

2016-05-23 Thread Ben Bacarisse
Chris Angelico writes: > On Tue, May 24, 2016 at 12:29 AM, Ben Bacarisse wrote: >> Right, but this is to miss the point. Let's say that 4000 years have >> defined 1/3 to be one third, but Python 3 (as do many programming >> languages) defines 1/3 to be something very very very very close to one

Re: Education [was Re: for / while else doesn't make sense]

2016-05-23 Thread Rob Gaddi
Marko Rauhamaa wrote: > Christopher Reimer : > >> Under various proposals in the U.S., everyone will soon learn how to >> program and/or become a computer scientist. Won't be long before some >> snotty-nosed brat graduates from preschool, takes a look at your code, >> and poops in his diapers. He

str(float) python 3 versus 2.7

2016-05-23 Thread Robin Becker
I had always imagined that the str founction did some kind of rounding on floats to prevent small numerical errors from showing up. The 2.7 documentation starts like this class str(object='') Return a string containing a nicely printable representation of an object. For s However, I see a

Re: for / while else doesn't make sense

2016-05-23 Thread Ian Kelly
On Mon, May 23, 2016 at 9:53 AM, Ian Kelly wrote: > I'm not sure where ℝ comes into this in the first place. Existing > Python numeric types only represent various subsets of ℚ (in the case > of fractions.Fraction, the entirety of ℚ). And of course I realized after sending that I forgot about com

Re: for / while else doesn't make sense

2016-05-23 Thread Chris Angelico
On Tue, May 24, 2016 at 1:47 AM, Steven D'Aprano wrote: > On Tue, 24 May 2016 12:57 am, Chris Angelico wrote: > >> On Tue, May 24, 2016 at 12:29 AM, Ben Bacarisse >> wrote: >>> Right, but this is to miss the point. Let's say that 4000 years have >>> defined 1/3 to be one third, but Python 3 (as

Re: for / while else doesn't make sense

2016-05-23 Thread Steven D'Aprano
On Tue, 24 May 2016 12:57 am, Chris Angelico wrote: > On Tue, May 24, 2016 at 12:29 AM, Ben Bacarisse > wrote: >> Right, but this is to miss the point. Let's say that 4000 years have >> defined 1/3 to be one third, but Python 3 (as do many programming >> languages) defines 1/3 to be something ve

Re: for / while else doesn't make sense

2016-05-23 Thread Jon Ribbens
On 2016-05-23, breamore...@gmail.com wrote: > On Monday, May 23, 2016 at 2:04:01 AM UTC+1, Jon Ribbens wrote: >> On 2016-05-23, Chris Angelico wrote: >> > The point of arithmetic in software is to do what mathematics defines. >> > Would you expect 1+2 to return 5? No. Why not? Where was the resul

Re: for / while else doesn't make sense

2016-05-23 Thread Rustom Mody
On Monday, May 23, 2016 at 7:59:47 PM UTC+5:30, Ben Bacarisse wrote: > Ian Kelly writes: > > > On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano wrote: > >> Are you saying that the Egyptians, Babylonians and Greeks didn't know how > >> to > >> work with fractions? > >> > >> http://mathworld.wolfr

Python 3.5 Cross Compile for ARM

2016-05-23 Thread billy . t . west
Hi. Can anyone point me to documentation/instructions for cross compiling Python 3.5? I'm trying to compile Python for an ARM processor. It seems like something broke with cross compilation in 3.5 and a patch was created (https://bugs.python.org/issue22359), but I don't even know where to beg

Re: for / while else doesn't make sense

2016-05-23 Thread Chris Angelico
On Tue, May 24, 2016 at 12:29 AM, Ben Bacarisse wrote: > Right, but this is to miss the point. Let's say that 4000 years have > defined 1/3 to be one third, but Python 3 (as do many programming > languages) defines 1/3 to be something very very very very close to one > third, and *that* idea is v

Re: for / while else doesn't make sense

2016-05-23 Thread Ian Kelly
On Mon, May 23, 2016 at 8:29 AM, Ben Bacarisse wrote: > Ian Kelly writes: > >> On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano >> wrote: >>> Are you saying that the Egyptians, Babylonians and Greeks didn't know how to >>> work with fractions? >>> >>> http://mathworld.wolfram.com/EgyptianFractio

Re: for / while else doesn't make sense

2016-05-23 Thread Ben Bacarisse
Ian Kelly writes: > On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano > wrote: >> Are you saying that the Egyptians, Babylonians and Greeks didn't know how to >> work with fractions? >> >> http://mathworld.wolfram.com/EgyptianFraction.html >> >> http://nrich.maths.org/2515 >> >> Okay, it's not qu

Re: for / while else doesn't make sense

2016-05-23 Thread Ian Kelly
On Mon, May 23, 2016 at 2:09 AM, Steven D'Aprano wrote: > Are you saying that the Egyptians, Babylonians and Greeks didn't know how to > work with fractions? > > http://mathworld.wolfram.com/EgyptianFraction.html > > http://nrich.maths.org/2515 > > Okay, it's not quite 4000 years ago. Sometimes my

Re: numpy problem

2016-05-23 Thread lists
> > On 23 mei 2016, at 14:19, Peter Otten <__pete...@web.de> wrote: > > li...@onemanifest.net wrote: > >> I've got a 2D array with values: >> >> values = np.array( >> [[ 20, 38, 4, 45, 65], >> [ 81, 44, 38, 57, 92], >> [ 92, 41, 16, 77, 44], >> [ 53, 62, 9, 75, 12], >> [ 58, 2, 60, 100,

Re: RFC: name for project of a cross version disassembler, and unmarshal program

2016-05-23 Thread Rustom Mody
On Monday, May 23, 2016 at 1:38:41 PM UTC+5:30, rocky wrote: > On Monday, May 23, 2016 at 2:17:07 AM UTC-4, Pete Forman wrote: > > rocky writes: > > > > > I'm looking for a good name for a relatively new project I'll put on pypy. > > > > > > I've been working on a module to disassemble Python byt

Re: numpy problem

2016-05-23 Thread Peter Otten
li...@onemanifest.net wrote: > I've got a 2D array with values: > > values = np.array( > [[ 20, 38, 4, 45, 65], > [ 81, 44, 38, 57, 92], > [ 92, 41, 16, 77, 44], > [ 53, 62, 9, 75, 12], > [ 58, 2, 60, 100, 29], > [ 63, 15, 48, 43, 71], > [ 80, 97, 87, 64, 60], > [ 16, 16, 70, 88,

numpy problem

2016-05-23 Thread lists
Hi, I've got a nympy problem I can't get my head around. (numpy is new to me). I've got a 2D array with values: values = np.array( [[ 20, 38, 4, 45, 65], [ 81, 44, 38, 57, 92], [ 92, 41, 16, 77, 44], [ 53, 62, 9, 75, 12], [ 58, 2, 60, 100, 29], [ 63, 15, 48, 43, 71], [ 80, 97, 87,

Re: variable argument unpacking

2016-05-23 Thread Peter Otten
Mehrzad Irani wrote: > Hi All, > > Consider the situation > [cti@iranim-rhel python_cti]$ cat a.py > def a(a = 1, b = 2, c = 3, *d, **e): > print(a, b, c) > print(d) > print(e) > > r = {'e': 7, 'f': 8, 'g': 9} > > > a(**r) > a(3, **r) > > r1 = (4,5,6) > > a(3,2,1,*r1,

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-23 Thread Steven D'Aprano
On Monday 23 May 2016 13:15, Siyi Deng wrote: > I have a dynamic library doing some numerical computations. > > I used ctypes to interact it by passing numpy arrays back and forth. > > Python 3.5 gives me the correct results. > > Python 2.7 gives me different, erroneous results, but it never cr

variable argument unpacking

2016-05-23 Thread Mehrzad Irani
Hi All, Consider the situation [cti@iranim-rhel python_cti]$ cat a.py def a(a = 1, b = 2, c = 3, *d, **e): print(a, b, c) print(d) print(e) r = {'e': 7, 'f': 8, 'g': 9} a(**r) a(3, **r) r1 = (4,5,6) a(3,2,1,*r1, **r) a(*r1, **r) r1 = (4,5,6,7) a(*r1, **r) [cti@iranim

Re: Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

2016-05-23 Thread Fabien
On 05/23/2016 05:15 AM, Siyi Deng wrote: I have a dynamic library doing some numerical computations. I used ctypes to interact it by passing numpy arrays back and forth. Python 3.5 gives me the correct results. Python 2.7 gives me different, erroneous results, but it never crashes. How is this po

Re: Setting Return-Path in email

2016-05-23 Thread Vincent Vande Vyvre
Le 23/05/2016 10:39, ragav s a écrit : Hi all, How can i add different Return-path and fromid in python.i have pasted the below code for preview def sendMail(sub,fromid,to,cc,html): msg = MIMEMultipart('alternative') msg['Subject'] = sub msg['From'] = fromid msg['To'] = to

Setting Return-Path in email

2016-05-23 Thread ragav s
Hi all, How can i add different Return-path and fromid in python.i have pasted the below code for preview def sendMail(sub,fromid,to,cc,html): msg = MIMEMultipart('alternative') msg['Subject'] = sub msg['From'] = fromid msg['To'] = to toaddress = [to] if cc: msg[

Re: for / while else doesn't make sense

2016-05-23 Thread Steven D'Aprano
On Monday 23 May 2016 10:36, Jon Ribbens wrote: > OK, I'm bored of you now. You clearly are not willing to imagine > a world beyond your own preconceptions. I am not saying that my view > is right, I'm just saying that yours is not automatically correct. > If you won't even concede that much then

Re: for / while else doesn't make sense

2016-05-23 Thread Steven D'Aprano
On Monday 23 May 2016 16:09, Rustom Mody wrote: > Steven is making wild and disingenuous statements; to wit: > > On Monday, May 23, 2016 at 3:39:19 AM UTC+5:30, Steven D'Aprano wrote: >> I'm not defining the result. 4000+ years of mathematics defines the result. > > This is off by on order of ma

Re: RFC: name for project of a cross version disassembler, and unmarshal program

2016-05-23 Thread rocky
On Monday, May 23, 2016 at 2:17:07 AM UTC-4, Pete Forman wrote: > rocky writes: > > > I'm looking for a good name for a relatively new project I'll put on pypy. > > > > I've been working on a module to disassemble Python bytecode from many > > versions of Python. (Right now 2.3 .. 3.5 bytecode, l

Re: Python and GPSD

2016-05-23 Thread dieter
John McKenzie writes: > I need help using the Python bindings for GPSD. Specifically, I would > like to take a latitude reading, put it in a variable and use it later. > The problem is that every example I see involves constantly taking > changing readings. That part I have working for myself

Re: for / while else doesn't make sense

2016-05-23 Thread Steven D'Aprano
On Monday 23 May 2016 03:25, Random832 wrote: > Why shouldn't Python do this? > > Imagine some future version of Python: x = 2/3 x > (2/3) type(x) > You would have a lot of trouble convincing Guido that this was a good idea, because that's what ABC used to do, and it was a perf