Re: An asyncio example

2015-07-03 Thread Adam Bartoš
> > 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 think so. When I tried this locally (using Python 3.4.0, so >>> >

Re: An asyncio example

2015-07-03 Thread Ian Kelly
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_eof() is the high-leve

Re: calculating entropy of image or alternative?

2015-07-03 Thread Robert Kern
On 2015-07-04 02:17, telmo bacile wrote: 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 homogeneo

Re: Matplotlib X-axis timezone trouble

2015-07-03 Thread Akira Li
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 desired, but > of course that doesn't solve the general problem of which this i

installing libraries like numpy scipy matplotlib

2015-07-03 Thread PIYUSH KUMAR
I have never used linux in my life.. only windows based computing.. So I have problems in installing third party libraries in python. I know this one is very basic and there are very experienced programmers in this group. So can somebody just explain me how many softwares or other python packages

Re: Should iPython Notebook replace Idle

2015-07-03 Thread Jason Swails
On Fri, Jul 3, 2015 at 10:01 PM, Sayth Renshaw wrote: > In future releases of Python should ipython Notebooks replace idle as the > default tool for new users to learn python? > This would as I see it have many benefits? > > 1. A nicer more usual web interface for new users. > 2. Would allow th

Should iPython Notebook replace Idle

2015-07-03 Thread Sayth Renshaw
In future releases of Python should ipython Notebooks replace idle as the default tool for new users to learn python? This would as I see it have many benefits? 1. A nicer more usual web interface for new users. 2. Would allow the python documentation and tutorials to be distributed as ipython

calculating entropy of image or alternative?

2015-07-03 Thread 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 homogeneous. I was thinking this code (entropy of i

Re: Bug in floating point multiplication

2015-07-03 Thread Jason Swails
On Fri, Jul 3, 2015 at 11:13 AM, Oscar Benjamin wrote: > On 2 July 2015 at 18:29, Jason Swails wrote: > > > > As others have suggested, this is almost certainly a 32-bit vs. 64-bit > > issue. Consider the following C program: > > > > // maths.h > > #include > > #include > > > > int main() { >

Re: Searching for a usable X509 implementation

2015-07-03 Thread Carl Meyer
Hi Dennis, On 07/03/2015 06:11 PM, Dennis Jacobfeuerborn wrote: > 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 switching the app t

Searching for a usable X509 implementation

2015-07-03 Thread Dennis Jacobfeuerborn
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 switching the app to another language all together. Apparently PyOpenSSL has no way to s

Re: An asyncio example

2015-07-03 Thread Terry Reedy
On 7/3/2015 4:33 PM, Adam Bartoš wrote: On Fri, Jul 3, 2015 at 7:38 PM, Adam Bartoš mailto:dre...@gmail.com>> wrote: Ian Kelly: >> 2) In the blocked situaction even KeyboardInterrupt doesn't break the loop, >> is that desired behavior? And why? > > I don't think so. When

Re: An asyncio example

2015-07-03 Thread Adam Bartoš
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 think so. When I tried this locally (using Python 3.4.0, so > > replacing "async def" with "

Re: An asyncio example

2015-07-03 Thread Adam Bartoš
>> Marko Rauhamaa: >>> socket.shutdown(socket.SHUT_WR) does the trick. >>> >>> I think the asyncio.StreamWriter.write_eof() is the high-level >>> equivalent. >> >> You are right that writer.write_eof() behaves like >> writer.transport.get_extra_info("socket").shutdown(socket.SHUT_WR) – >> the serve

Re: An asyncio example

2015-07-03 Thread Marko Rauhamaa
Adam Bartoš : > Marko Rauhamaa: >> socket.shutdown(socket.SHUT_WR) does the trick. >> >> I think the asyncio.StreamWriter.write_eof() is the high-level >> equivalent. > > You are right that writer.write_eof() behaves like > writer.transport.get_extra_info("socket").shutdown(socket.SHUT_WR) – > the

Re: An asyncio example

2015-07-03 Thread Adam Bartoš
Ian Kelly: >> 2) In the blocked situaction even KeyboardInterrupt doesn't break the loop, >> is that desired behavior? And why? > > I don't think so. When I tried this locally (using Python 3.4.0, so > replacing "async def" with "def" and "await" with "yield from" and > "loop.create_task" with "as

Re: Bug in floating point multiplication

2015-07-03 Thread Irmen de Jong
On 3-7-2015 7:07, Ned Deily wrote: > In article <559579bb$0$2921$e4fe5...@news.xs4all.nl>, > Irmen de Jong wrote: >> Tested on Mac OSX 10.10.4, with a 64-bit core2duo processor. Below are all >> 64-bit python >> implementations: >> 2.6.9 (apple supplied), 2.7.6 (apple supplied), 3.4.3 (homebrew)

Re: An asyncio example

2015-07-03 Thread Marko Rauhamaa
>> 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_eof() is the high-level equivalent. Marko -- https://mail.python.org/mailman/listinf

Re: Bug in floating point multiplication

2015-07-03 Thread Oscar Benjamin
On 2 July 2015 at 18:29, Jason Swails wrote: > > As others have suggested, this is almost certainly a 32-bit vs. 64-bit > issue. Consider the following C program: > > // maths.h > #include > #include > > int main() { > double x; > int i; > x = 1-pow(0.5, 53); > > for (i = 1; i <

Re: An asyncio example

2015-07-03 Thread Ian Kelly
On Fri, Jul 3, 2015 at 8:31 AM, Ian Kelly wrote: > On Fri, Jul 3, 2015 at 4:28 AM, Adam Bartoš wrote: >> Hello, >> >> I'm experimenting with asyncio. I have composed the following code. There is >> a server handler and a client handler. I didn't want to split the code into >> two files so I just

Re: An asyncio example

2015-07-03 Thread Ian Kelly
On Fri, Jul 3, 2015 at 4:28 AM, Adam Bartoš wrote: > Hello, > > I'm experimenting with asyncio. I have composed the following code. There is > a server handler and a client handler. I didn't want to split the code into > two files so I just used a socketpair, inspired by example > https://docs.pyt

An asyncio example

2015-07-03 Thread Adam Bartoš
Hello, I'm experimenting with asyncio. I have composed the following code. There is a server handler and a client handler. I didn't want to split the code into two files so I just used a socketpair, inspired by example https://docs.python.org/3/library/asyncio-stream.html#register-an-open-socket-t