Re: Looking up a dictionary _key_ by key?

2015-07-04 Thread Laura Creighton
In a message of Tue, 23 Jun 2015 18:06:45 -0700, Paul Rubin writes: >Chris Angelico writes: >>> Would I have to do an O(n) search to find my key? >> Iterate over it - it's an iterable view in Py3 - and compare. > >I think the question was whether the O(n) search could be avoided, not >how to do it

EuroPython 2015 Keynote: Holger Krekel

2015-07-04 Thread M.-A. Lemburg
We are pleased to introduce our next keynote speaker for EuroPython 2015: Holger Krekel. He will be giving a keynote on Wednesday, July 22. About Holger Krekel --- Holger is a prolific Python developer with a strong interest in communication: “Socially this means engaging and c

Re: Python 3 resuma a file download

2015-07-04 Thread zljubisic
I have a working solution. :) The function below will download a file securely. Thank anyone who helped. I wouldn't be able to write this function without your help. I hope, someone else will benefit from our united work. Best regards. import os import urllib.request def Download(rfile, lfile):

Re: Searching for a usable X509 implementation

2015-07-04 Thread Laura Creighton
In a message of Sun, 05 Jul 2015 02:27:22 +0200, Laura Creighton writes: >In a message of Fri, 03 Jul 2015 17:11:10 -0700, Dennis Jacobfeuerborn writes: >>Hi, >>I'm trying to implement certificate functionality in a python app but after >>fighting with pyOpenSSL and M2Crypto I'm thinking about wri

Re: Can't call file from another - well correctly

2015-07-04 Thread Sayth Renshaw
On Sunday, 5 July 2015 10:23:17 UTC+10, Sayth Renshaw wrote: > I was playing with odo(blaze http://blaze.pydata.org/en/latest/) and wanted > to use it with a current script I have been using on the command line. > > So my 2 scripts are below, I will explain here hopefully to keep question > cle

Re: Searching for a usable X509 implementation

2015-07-04 Thread Laura Creighton
In a message of Fri, 03 Jul 2015 17:11:10 -0700, Dennis Jacobfeuerborn writes: >Hi, >I'm trying to implement certificate functionality in a python app but after >fighting with pyOpenSSL and M2Crypto I'm thinking about writing wrapper >functions for the OpenSSL command line tool instead or switchi

Can't call file from another - well correctly

2015-07-04 Thread Sayth Renshaw
I was playing with odo(blaze http://blaze.pydata.org/en/latest/) and wanted to use it with a current script I have been using on the command line. So my 2 scripts are below, I will explain here hopefully to keep question clearer what I have done. Script 2 works for me from the command line as p

Re: Should iPython Notebook replace Idle

2015-07-04 Thread Sayth Renshaw
On Sunday, 5 July 2015 05:16:04 UTC+10, Sturla Molden wrote: > Jason Swails wrote: > > > Everything gets swallowed into Python. I can't imagine this ever happening. > > IPython's successor Jupyter is also an REPL environment for Julia and R, > and many other languages will also be supported (e

Re: Bug in floating point multiplication

2015-07-04 Thread Laura Creighton
In a message of Fri, 03 Jul 2015 00:52:55 +1000, "Steven D'Aprano" writes: >Despite the title, this is not one of the usual "Why can't Python do >maths?" "bug" reports. > >Can anyone reproduce this behaviour? If so, please reply with the version of >Python and your operating system. Printing sys.ve

Re: installing libraries like numpy scipy matplotlib

2015-07-04 Thread Terry Reedy
On 7/4/2015 10:58 AM, Jens Thoms Toerring wrote: PIYUSH KUMAR wrote: I have never used linux in my life.. only windows based computing.. So I have problems in installing third party libraries in python. The numpy and scipy projects create Windows binararies for all recent releases that are a

Re: An asyncio example

2015-07-04 Thread Terry Reedy
On 7/4/2015 3:04 AM, Adam Bartoš wrote: This is a minimal example: import asyncio async def wait(): await asyncio.sleep(5) loop = asyncio.get_event_loop() loop.run_until_complete(wait()) Ctrl-C doesn't interrupt the waiting, instead KeyboardInterrupt occurs after those five seconds. It'

Re: Should iPython Notebook replace Idle

2015-07-04 Thread Sturla Molden
Jason Swails wrote: > Everything gets swallowed into Python. I can't imagine this ever happening. IPython's successor Jupyter is also an REPL environment for Julia and R, and many other languages will also be supported (e.g. Java and C++). Having this swallowed into Python is probably never go

Re: Matplotlib X-axis timezone trouble [SOLVED]

2015-07-04 Thread Peter Pearson
On Sat, 04 Jul 2015 07:29:45 +0300, Akira Li <4kir4...@gmail.com> wrote: > Peter Pearson writes: > >> The following code produces a plot with a line running from (9:30, 0) to >> (10:30, 1), not from (8:30, 0) to (9:30, 1) as I desire. >> >> If I use timezone None instead of pacific, the plot is as

Re: installing libraries like numpy scipy matplotlib

2015-07-04 Thread Jens Thoms Toerring
PIYUSH KUMAR wrote: > I have never used linux in my life.. only windows based computing.. So I > have problems in installing third party libraries in python. It depends. One question is if there's already a ready-for-use package for the third party library you want to install. If that is the case

Re: An asyncio example

2015-07-04 Thread Adam Bartoš
On Sat, Jul 4, 2015 at 1:07 PM, Adam Bartoš wrote: > On Fri, Jul 3, 2015 at 9:14 AM, Marko Rauhamaa >> wrote: >> > >> >>> 1) is there a way to close just one direction of the connection? >> >> >> >> No. SOCK_STREAM sockets are always bidirectional. >> > >> > socket.shutdown(socket.SHUT_WR) does

Re: calculating entropy of image or alternative?

2015-07-04 Thread Christian Gollwitzer
Am 04.07.15 um 03:17 schrieb telmo bacile: Hi list, I found a code that calculates entropy of images with python that can be used for classifying interesting images from uninteresting ones. Interesting images has more structured patterns while uninsteresting are more noisy or completely homogen

Re: An asyncio example

2015-07-04 Thread Adam Bartoš
> > On Fri, Jul 3, 2015 at 9:14 AM, Marko Rauhamaa > wrote: > > > >>> 1) is there a way to close just one direction of the connection? > >> > >> No. SOCK_STREAM sockets are always bidirectional. > > > > socket.shutdown(socket.SHUT_WR) does the trick. > > > > I think the asyncio.StreamWriter.write_

Re: An asyncio example

2015-07-04 Thread Adam Bartoš
On Sat, Jul 4, 2015 at 8:45 AM, Adam Bartoš wrote: > On Fri, Jul 3, 2015 at 7:38 PM, Adam Bartoš wrote: >>> Ian Kelly: >>> >> 2) In the blocked situaction even KeyboardInterrupt doesn't break the loop >>> >> is that desired behavior? And why? >>> > >>> > I don't thi