Re: How to sort over dictionaries

2018-08-28 Thread John Ladasky
The top-level object you are showing is a list [], not a dictionary {}. It has dictionaries inside of it though. Do you want to sort the list? Python's sorted() function returns a sorted copy of a sequence. Sorted() has an optional argument called "key". Key accepts a second function which c

Re: Module not found

2018-08-28 Thread Sharan Basappa
On Monday, 27 August 2018 22:45:47 UTC+5:30, Peter Otten wrote: > Sharan Basappa wrote: > > > I am running a program that I got as reference from GitHub. > > I am running on windows OS. > > > > Here is a snippet of the code (initial few lines). > > > > #!/usr/bin/env python > > # -*- coding: ut

Re: Question about floating point

2018-08-28 Thread Gregory Ewing
Frank Millman wrote: I have been trying to explain why they should use the decimal module. They have had a counter-argument from someone else who says they should just use the rounding technique in my third example above. It's possible to get away with this by judicious use of rounding. There

Re: Broken pip

2018-08-28 Thread Gregory Ewing
Chris Angelico wrote: On 2018-08-28 13:19, Larry Martell wrote: source .bashrc I'm not sure what the point of it is, but maybe it's ensuring that your $PATH is set correctly. The installation you just did might have edited your .bashrc file (to modify PATH etc.), so it ensures that your curre

Re: virtualenv and ubuntu

2018-08-28 Thread Stone Zhong
On Tuesday, August 28, 2018 at 8:00:17 AM UTC-7, Matt Ruffalo wrote: > On 2018-08-28 07:26, stone.zh...@gmail.com wrote: > > Hi there, > > > > Sorry if the question is naive, I am on Ubuntu 16.04 with Python 3.5.2, now > > I want to use virtualenv, I noticed there are two ways to get virtualenv >

Re: Broken pip

2018-08-28 Thread Michael F. Stemper
On 2018-08-28 13:45, Chris Angelico wrote: > On Wed, Aug 29, 2018 at 4:37 AM, Michael F. Stemper > wrote: >> On 2018-08-28 13:19, Larry Martell wrote: >>> On Tue, Aug 28, 2018 at 2:10 PM, Michael F. Stemper >>> wrote: I'm trying to upgrade my pip on Ubuntu 16.04. I appear to have bugge

Re: Broken pip

2018-08-28 Thread Chris Angelico
On Wed, Aug 29, 2018 at 4:37 AM, Michael F. Stemper wrote: > On 2018-08-28 13:19, Larry Martell wrote: >> On Tue, Aug 28, 2018 at 2:10 PM, Michael F. Stemper >> wrote: >>> >>> I'm trying to upgrade my pip on Ubuntu 16.04. I appear to have >>> buggered things up pretty well. (Details follow) Any s

Re: Broken pip

2018-08-28 Thread Michael F. Stemper
On 2018-08-28 13:19, Larry Martell wrote: > On Tue, Aug 28, 2018 at 2:10 PM, Michael F. Stemper > wrote: >> >> I'm trying to upgrade my pip on Ubuntu 16.04. I appear to have >> buggered things up pretty well. (Details follow) Any suggestions >> on how to undo this and get everything back to proper

Re: Broken pip

2018-08-28 Thread Larry Martell
On Tue, Aug 28, 2018 at 2:10 PM, Michael F. Stemper wrote: > > I'm trying to upgrade my pip on Ubuntu 16.04. I appear to have > buggered things up pretty well. (Details follow) Any suggestions > on how to undo this and get everything back to proper operation? > > Based on the information that I fo

Broken pip

2018-08-28 Thread Michael F. Stemper
I'm trying to upgrade my pip on Ubuntu 16.04. I appear to have buggered things up pretty well. (Details follow) Any suggestions on how to undo this and get everything back to proper operation? Based on the information that I found at: , I did the following:

Re: Question about floating point

2018-08-28 Thread Rob Gaddi
On 08/28/2018 07:11 AM, Frank Millman wrote: Hi all I know about this gotcha - x = 1.1 + 2.2 x 3.3003 According to the docs, the reason is that "numbers like 1.1 and 2.2 do not have exact representations in binary floating point." So when I do this - y = 3.3 y 3.3 what exa

Re: Question about floating point

2018-08-28 Thread MRAB
On 2018-08-28 15:11, Frank Millman wrote: Hi all I know about this gotcha - x = 1.1 + 2.2 x 3.3003 According to the docs, the reason is that "numbers like 1.1 and 2.2 do not have exact representations in binary floating point." So when I do this - y = 3.3 y 3.3 what exactly

Re: virtualenv and ubuntu

2018-08-28 Thread Matt Ruffalo
On 2018-08-28 07:26, stone.zh...@gmail.com wrote: > Hi there, > > Sorry if the question is naive, I am on Ubuntu 16.04 with Python 3.5.2, now I > want to use virtualenv, I noticed there are two ways to get virtualenv > installed: > > 1) do "sudo apt-get install virtualenv" > 2) do "pip3 install v

Re: Question about floating point

2018-08-28 Thread Chris Angelico
On Wed, Aug 29, 2018 at 12:47 AM, Frank Millman wrote: > They were interesting, but actually did not answer the question that I > forgot to ask! > > The reason for my query is this. I am assisting someone with an application > involving monetary values. I have been trying to explain why they shoul

Re: Question about floating point

2018-08-28 Thread Frank Millman
"Frank Millman" wrote in message news:pm3l2m$kv4$1...@blaine.gmane.org... I know about this gotcha - >>> x = 1.1 + 2.2 >>> x 3.3003 [...] >>> y = 3.3 >>> y 3.3 [...] >>> z = (1.1 + 2.2) * 10 / 10 >>> z 3.3 Thanks to Chris and Stephen for the replies. They were interestin

Re: Question about floating point

2018-08-28 Thread Grant Edwards
On 2018-08-28, Frank Millman wrote: x = 1.1 + 2.2 x > 3.3003 > > According to the docs, the reason is that "numbers like 1.1 and 2.2 do not > have exact representations in binary floating point." Right. > So when I do this - > y = 3.3 y > 3.3 > > what exactly is

Re: Question about floating point

2018-08-28 Thread Stephen Tucker
Hi Frank, One difference is that, in order to carry out the instructions embodied in the first example, the computer has to perform arithmetic. And it adds the binary approximation of 1.1 (which is very slightly wrong) to the binary approximation of 2.2 (which, again, is very slightly wrong). It t

Re: Question about floating point

2018-08-28 Thread Chris Angelico
On Wed, Aug 29, 2018 at 12:11 AM, Frank Millman wrote: > Hi all > > I know about this gotcha - > x = 1.1 + 2.2 x > > 3.3003 > > According to the docs, the reason is that "numbers like 1.1 and 2.2 do not > have exact representations in binary floating point." > > So when I do

Question about floating point

2018-08-28 Thread Frank Millman
Hi all I know about this gotcha - x = 1.1 + 2.2 x 3.3003 According to the docs, the reason is that "numbers like 1.1 and 2.2 do not have exact representations in binary floating point." So when I do this - y = 3.3 y 3.3 what exactly is happening? What is 'y' at this point?

Re: virtualenv and ubuntu

2018-08-28 Thread Kunal Jamdade
Hi, If you install with sudo it is installed for 2 users i.e current logged in as well as root. So if one login as root can use the installed "env". But if you install it with pip it will be used by the current logged in user. In my opinion, use pip to install virtualenv On Tue, Aug 28, 2018 at

virtualenv and ubuntu

2018-08-28 Thread stone . zhong
Hi there, Sorry if the question is naive, I am on Ubuntu 16.04 with Python 3.5.2, now I want to use virtualenv, I noticed there are two ways to get virtualenv installed: 1) do "sudo apt-get install virtualenv" 2) do "pip3 install virtualenv" What is the preferred way to install virtualenv? Th

EuroPython 2018: Please send in your feedback

2018-08-28 Thread M.-A. Lemburg
We will be closing the EuroPython 2018 feedback form end of August, so if you've attended EuroPython last month and would like to help improve EuroPython by providing feedback, please please take a few moments and fill in our feedback form: * EuroPython 2018 Feedback Form *