Re: Python 3 success story

2015-03-30 Thread Terry Reedy
On 3/30/2015 8:24 PM, Mario Figueiredo wrote: On Mon, 30 Mar 2015 19:28:16 -0400, Terry Reedy wrote: So I suggested going ahead and testing PyBrain by using it. This appears to have worked out well. I believe the only 2-3 issue she ran into was a '/' that needed to become '//', that either 2

Re: Python JSON processing - extra data error

2015-03-30 Thread dieter
karthik.sha...@gmail.com writes: > I have the following python program to read a set of JSON files do some > processing on it and dump them back to the same folder. However When I run > the below program and then try to see the output of the JSON file using > > `cat file.json | python -m json.to

Using csv DictWriter - add a extra field

2015-03-30 Thread Victor Hooi
Hi, I have a dict named "connections", with items like the following: In [18]: connections Out[18]: {'3424234': {'end_timestamp': datetime.datetime(2015, 3, 25, 5, 31, 30, 406000, tzinfo=datetime.timezone(datetime.timedelta(-1, 61200))), 'ip_address': '10.168.8.36:52440', 'open_timestamp': d

Re: Image rotation issue

2015-03-30 Thread Chris Angelico
On Tue, Mar 31, 2015 at 3:04 PM, wrote: > Neither one produces good output when the compression is applied. Oh well, was worth a try. > Don't think it's related to fax standards - it's proprietary (E-Ink Tile) Doesn't need to be specifically _related_, but it's looking similar. If you could do

Re: Image rotation issue

2015-03-30 Thread high5storage
On Monday, 30 March 2015 16:48:08 UTC-7, Chris Angelico wrote: > On Tue, Mar 31, 2015 at 8:22 AM, wrote: > > rotimg = img.rotate(270) # rotation is counterclockwise > > Unless the 90 and 270 cases are documented as being handled specially, > I'd look for a dedicated function for doing those cha

Re: Hypothesis 1.0: A production quality property-based testing library for Python

2015-03-30 Thread Paul Rubin
David MacIver writes: > Hypothesis is based on Quickcheck > (https://wiki.haskell.org/Introduction_to_QuickCheck2) This is great. Have you looked at the Erlang version of Quickcheck? It may have aspects more directly applicable to Python, since Erlang is dynamically typed like Python is. -- ht

Re: Hypothesis 1.0: A production quality property-based testing library for Python

2015-03-30 Thread Terry Reedy
On 3/30/2015 4:46 PM, David MacIver wrote: On 30 March 2015 at 22:37, Terry Reedy mailto:tjre...@udel.edu>> wrote: https://www.python.org/dev/__peps/pep-0484/ proposes the addition of a 'typing' module for defining types beyond the bu

Re: Python 3 success story

2015-03-30 Thread Mario Figueiredo
On Mon, 30 Mar 2015 19:28:16 -0400, Terry Reedy wrote: > >So I suggested going ahead and testing PyBrain by using it. This >appears to have worked out well. I believe the only 2-3 issue she ran >into was a '/' that needed to become '//', that either 2to3 or I missed >in the initial conversion

Re: Image rotation issue

2015-03-30 Thread Chris Angelico
On Tue, Mar 31, 2015 at 8:22 AM, wrote: > rotimg = img.rotate(270) # rotation is counterclockwise Unless the 90 and 270 cases are documented as being handled specially, I'd look for a dedicated function for doing those changes. A quick perusal of the docs showed up this: http://pillow.readthedo

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-30 Thread Ben Finney
John Nagle writes: > That's part of the problem of having all those forks - now > each bug has to be fixed in each fork. Agreed, there is too much focus on developing everything in isolation, too little focus on getting different libraries working together. > After all this, the production syst

Python 3 success story

2015-03-30 Thread Terry Reedy
Last summer, a college student, who prefers Python to Java and Racket (her other CS course languages), wanted to do a year-long AI research project using PyBrain (for the ai part), numpy (required for PyBrain), and pygame (for animated displays). We both preferred 3.x. That was not an issue f

Re: Error in processing JSON files in Python

2015-03-30 Thread MRAB
On 2015-03-30 22:27, Karthik Sharma wrote: I have the following python program to read a set of JSON files do some processing on it and dump them back to the same folder. However When I run the below program and then try to see the output of the JSON file using `cat file.json | python -m json.

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-30 Thread Terry Reedy
On 3/30/2015 4:07 PM, John Nagle wrote: After all this, the production system is now running entirely on Python 3. I am really glad to read this. Aside from a bit of hyperbole, I appreciate the report of successes and difficulties. I also understand better that 'Python 3' means something d

Re: Image rotation issue

2015-03-30 Thread Ian Kelly
On Mon, Mar 30, 2015 at 3:22 PM, wrote: > rotimg = img.rotate(270) # rotation is counterclockwise > > # i can almost make it work by resizing rotimg here, but the aspect ratio is > then screwed > #rotimg = rotimg.resize((1024, 1280)) > > rotimg.show() > imagedata = list(rotimg.getdata()) > > But

Error in processing JSON files in Python

2015-03-30 Thread Karthik Sharma
I have the following python program to read a set of JSON files do some processing on it and dump them back to the same folder. However When I run the below program and then try to see the output of the JSON file using `cat file.json | python -m json.tool` I get the following error `extra data

Image rotation issue

2015-03-30 Thread kai . peters
Last week some readers have kindly supplied ideas and code for a question I had asked around a form of image data compression required for specialized display hardware. I was able to solve my issues for all but one: The black & white only device (1024 (X) x 1280 (Y)) expects the compressed dat

Python JSON processing - extra data error

2015-03-30 Thread karthik . sharma
I have the following python program to read a set of JSON files do some processing on it and dump them back to the same folder. However When I run the below program and then try to see the output of the JSON file using `cat file.json | python -m json.tool` I get the following error `extra dat

Re: Communicating with multiple clients using one TCP socket pyt

2015-03-30 Thread Ian Kelly
On Mon, Mar 30, 2015 at 2:43 AM, bobbdeep wrote: > Also, when once client is connected to the server, the other cannot connect > to the server. Any ideas on how to do this ? While one client is connected, the server can't accept new connections because it's tied up in a blocking call to recv, wa

Re: Hypothesis 1.0: A production quality property-based testing library for Python

2015-03-30 Thread David MacIver
On 30 March 2015 at 22:37, Terry Reedy wrote: > On 3/30/2015 2:44 PM, David MacIver wrote: > >> Hypothesis is a Python library for turningunit tests into generative >> tests, covering a far wider range of cases thanyou can manually. Rather >> than just testing for thethings you already know about

Re: Hypothesis 1.0: A production quality property-based testing library for Python

2015-03-30 Thread Terry Reedy
On 3/30/2015 2:44 PM, David MacIver wrote: Hypothesis is a Python library for turningunit tests into generative tests, covering a far wider range of cases thanyou can manually. Rather than just testing for thethings you already know about, Hypothesis goes out and actively hunts forbugs in your co

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-30 Thread John Nagle
On 3/29/2015 7:11 PM, John Nagle wrote: > Meanwhile, I've found two more variants on "flup" > > https://pypi.python.org/pypi/flipflop > https://pypi.python.org/pypi/flup6 > > All of these are descended from the original "flup" code base. > > PyPi also has > > fcgi-python (

Hypothesis 1.0: A production quality property-based testing library for Python

2015-03-30 Thread David MacIver
Hypothesis is a Python library for turning unit tests into generative tests, covering a far wider range of cases than you can manually. Rather than just testing for the things you already know about, Hypothesis goes out and actively hunts for bugs in your code. It usually finds them, and when it do

Re: Setuptools Confusion

2015-03-30 Thread Ben Finney
Rob Gaddi writes: > I'm having two issues trying to make setuptools do what I want to package > up an application. Those questions are on-topic here. It's worth noting, though, that you may get better discussion of this by asking in the Distutils forum https://www.python.org/community/sigs/curr

Re: Strategy/ Advice for How to Best Attack this Problem?

2015-03-30 Thread Dave Angel
On 03/30/2015 12:45 PM, Saran A wrote: On Sunday, March 29, 2015 at 10:04:45 PM UTC-4, Chris Angelico wrote: On Mon, Mar 30, 2015 at 12:08 PM, Paul Rubin wrote: Saran Ahluwalia writes: cross-platform... * Monitors a folder for files that are dropped throughout the day I don't see a cross-p

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-30 Thread Denis McMahon
On Mon, 30 Mar 2015 15:47:23 +1100, Chris Angelico wrote: > On Mon, Mar 30, 2015 at 3:35 PM, Paul Rubin > wrote: >> 2b. John, thank you for describing your experience and making the >> community's picture of the current overall state of Python 3 more >> accurate. It was apparently a bit too rosy

Setuptools Confusion

2015-03-30 Thread Rob Gaddi
I'm having two issues trying to make setuptools do what I want to package up an application. Well, actually I'm having many issues, but I'll start with the two that are foremost right now. First, I've got documentation in RestructuredText format that I want to cook down to HTML to include in w

Re: Communicating with multiple clients using one TCP socket pyt

2015-03-30 Thread sohcahtoa82
On Monday, March 30, 2015 at 1:44:17 AM UTC-7, bobbdeep wrote: > I am using TCP sockets to communicate between my server and clients. The > server code and socket code are as below: > > server: > > from socket import * > > HOST = 'xx.xx.xx.xx' > PORT = 1999 > serversocket = socket(AF_INET,SOCK_

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-30 Thread Denis McMahon
On Sun, 29 Mar 2015 11:57:54 -0700, John Nagle wrote: > The Python 2 module "fcgi" is gone in Python 3. Was this part of the python standard library, or was it a third party library? I can only find cgi documentation in the python 2 core documentatio

Re: Strategy/ Advice for How to Best Attack this Problem?

2015-03-30 Thread Saran A
On Sunday, March 29, 2015 at 10:04:45 PM UTC-4, Chris Angelico wrote: > On Mon, Mar 30, 2015 at 12:08 PM, Paul Rubin wrote: > > Saran Ahluwalia writes: > >> cross-platform... > >> * Monitors a folder for files that are dropped throughout the day > > > > I don't see a cross-platform way to do that

Re: Sudoku solver

2015-03-30 Thread BartC
On 29/03/2015 08:57, Christian Gollwitzer wrote: Am 29.03.15 um 05:06 schrieb Steven D'Aprano: [OT: Competing with compiled C code] I'm not one of those people who think that C is by definition the fastest language conceivable. (People who believe this sometimes make an exception for hand-cra

Re: Python 3 lack of support for fcgi/wsgi.

2015-03-30 Thread Mark Lawrence
On 30/03/2015 02:22, Ben Finney wrote: Paul Rubin writes: He reported hitting more snags than some of us might expect purely from the Python 3 propaganda ("oh, just run the 2to3 utility and it does everything for you"). Propaganda? Are you referring to the official guidelines for migrating

Re: Sudoku solver

2015-03-30 Thread Marko Rauhamaa
mr.smit...@gmail.com: > You say "neater implementation" > I'll send you to the code-golf site: > http://codegolf.stackexchange.com/a/446/38632 this is brute force. > There are some really good implementations in other languages that > arent brute force. It ain't neater if it don't fit in your pos

Re: Sudoku solver

2015-03-30 Thread Marko Rauhamaa
Ian Kelly : > On Mon, Mar 30, 2015 at 1:13 AM, Christian Gollwitzer > wrote: >> Am 30.03.15 um 08:50 schrieb Ian Kelly: >>> >>> On Sun, Mar 29, 2015 at 12:03 PM, Marko Rauhamaa >>> wrote: Be careful with the benchmark comparisons. Ian's example can be solved with the identical alg

Re: Sudoku solver

2015-03-30 Thread Chris Angelico
On Mon, Mar 30, 2015 at 7:57 PM, Ian Kelly wrote: > On Mon, Mar 30, 2015 at 2:16 AM, Dave Angel wrote: >> The relationship between row, column and box can be rearranged. Some of >> these are already covered by the rotations proposed earlier, where for a 90 >> degree rotate, row becomes column an

Re: Sudoku solver

2015-03-30 Thread Ian Kelly
On Mon, Mar 30, 2015 at 2:16 AM, Dave Angel wrote: > The relationship between row, column and box can be rearranged. Some of > these are already covered by the rotations proposed earlier, where for a 90 > degree rotate, row becomes column and column becomes row. But in a similar > way each box c

Communicating with multiple clients using one TCP socket pyt

2015-03-30 Thread bobbdeep
I am using TCP sockets to communicate between my server and clients. The server code and socket code are as below: server: from socket import * HOST = 'xx.xx.xx.xx' PORT = 1999 serversocket = socket(AF_INET,SOCK_STREAM) serversocket.bind((HOST,PORT)) print 'bind success' serversocket.listen(5)

[RELEASED] Python 3.5.0a3 is now available

2015-03-30 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm thrilled to announce the availability of Python 3.5.0a3. Python 3.5.0a3 is the third alpha release of Python 3.5, which will be the next major release of Python. Python 3.5 is still under heavy development,

Re: TCP sockets python timeout public IP adresss

2015-03-30 Thread bobbdeep
On Sunday, March 29, 2015 at 2:27:59 PM UTC+5:30, bobbdeep wrote: > I am trying to communicate between a server and client using TCP sockets. > > Server code: > > import socket > import sys > > # Create a TCP/IP socket > sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) > # B

Re: Sudoku solver

2015-03-30 Thread Dave Angel
On 03/30/2015 03:29 AM, Ian Kelly wrote: On Mon, Mar 30, 2015 at 1:13 AM, Christian Gollwitzer wrote: Am 30.03.15 um 08:50 schrieb Ian Kelly: On Sun, Mar 29, 2015 at 12:03 PM, Marko Rauhamaa wrote: Be careful with the benchmark comparisons. Ian's example can be solved with the identical al

Re: cgi parse_qs still exists?

2015-03-30 Thread Mark Lawrence
On 30/03/2015 07:48, dieter wrote: Mark Lawrence writes: This has been marked for deprecation since at least 2.6 but is still in the 3.5 code base. Does anybody know if this is by accident or design? If the former I'll happily raise an issue to get it removed unless somebody beats me to it.

Re: Sudoku solver

2015-03-30 Thread Ian Kelly
On Mon, Mar 30, 2015 at 1:13 AM, Christian Gollwitzer wrote: > Am 30.03.15 um 08:50 schrieb Ian Kelly: >> >> On Sun, Mar 29, 2015 at 12:03 PM, Marko Rauhamaa wrote: >>> >>> Be careful with the benchmark comparisons. Ian's example can be solved >>> with the identical algorithm in eight different w

Re: Sudoku solver

2015-03-30 Thread Christian Gollwitzer
Am 30.03.15 um 08:50 schrieb Ian Kelly: On Sun, Mar 29, 2015 at 12:03 PM, Marko Rauhamaa wrote: Be careful with the benchmark comparisons. Ian's example can be solved with the identical algorithm in eight different ways (four corners, left or right). I ran the example with my recent Python solv