Re: using HTTPHandler cause Django server side shows http 400 and Invalid HTTP_HOST header message

2017-04-04 Thread Steven D'Aprano
On Tue, 04 Apr 2017 21:06:23 -0700, iMath wrote: > For those want to help, I also posted The question here > http://stackoverflow.com/questions/43185804/using-httphandler-cause- django-server-side-shows-http-400-and-invalid-http-host > > > I am using HTTPHandler to send logging messages to a Dja

Re: Does automatic golden master unittest generation exist/or is it feasible?

2017-04-04 Thread Steven D'Aprano
On Tue, 04 Apr 2017 19:40:03 -0700, fleshw wrote: > People told me that there's a similar concept called "Golden Master > Testing" where it keeps a "golden record" and runs test case on it. So > it looks like I'm trying to automate golden master testing. > > So my question is this: > > 1. Is thi

Does automatic golden master unittest generation exist/or is it feasible?

2017-04-04 Thread fleshw
I have a really large and mature codebase in py2, but with no test or documentation. To resolve this I just had a simple idea to automatically generate tests and this is how: 1. Have a decorator that logs all arguments and return values 2. Put them in a test case and have it run in production

RE: Two variable dictionary comprehension

2017-04-04 Thread Deborah Swanson
Rob Gaddi wrote, on Tuesday, April 04, 2017 3:56 PM > > On 04/04/2017 03:34 PM, Deborah Swanson wrote: > > Terry Reedy wrote, on Tuesday, April 04, 2017 11:04 AM > >> > >> I am sure that this is because list comprehensions were once thr only > >> comprehensions and that the index was not updated

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-04 Thread Mikhail V
On 3 April 2017 at 19:55, Steve D'Aprano wrote: > I didn't see you calling out Rick for his prejudice against those who aren't > American, his absurd belief that "most" people are satisfied with ASCII, Hmm... that is interesting. Everyone has some beliefs... If I make a bit more on-topic questio

RE: Two variable dictionary comprehension

2017-04-04 Thread Deborah Swanson
Sorry I bailed on you last night, but you know it's bad when you can't read anymore. I read through this today and saw several things I really need to work with more, especially dicts, sets, generators and the zip function. I've used all of them in fairly typical forms, but it's the atypical ones

Re: Two variable dictionary comprehension

2017-04-04 Thread Rob Gaddi
On 04/04/2017 03:34 PM, Deborah Swanson wrote: Terry Reedy wrote, on Tuesday, April 04, 2017 11:04 AM On 4/3/2017 2:35 AM, Gregory Ewing wrote: Deborah Swanson wrote: Oh, come on. That's a fairly obscure citation in the docs, one that would take a good deal of experience and time reading

RE: Two variable dictionary comprehension

2017-04-04 Thread Deborah Swanson
Terry Reedy wrote, on Tuesday, April 04, 2017 11:04 AM > > On 4/3/2017 2:35 AM, Gregory Ewing wrote: > > Deborah Swanson wrote: > > > >> Oh, come on. That's a fairly obscure citation in the docs, > one that > >> would take a good deal of experience and time reading > through them to > >> know

Re: Appending data to a json file

2017-04-04 Thread MRAB
On 2017-04-04 21:00, Dennis Lee Bieber wrote: On Tue, 4 Apr 2017 13:23:52 -0400, Dave declaimed the following: I don't care for the idea of replacing the data file for every save. My preference would to append to the existing data file - makes more sense. However, that is not how json works.

[ANNOUNCE] Mail Drake version 0.1.7

2017-04-04 Thread Ben Finney
Howdy all, I am pleased to present Mail Drake (version 0.1.7), now available at PyPI https://pypi.python.org/pypi/maildrake>. Mail Drake is a development tool for testing email traffic. Run Mail Drake’s SMTP server on a local port, send email to it, and inspect the message queue in a local web b

Re: Two variable dictionary comprehension

2017-04-04 Thread Terry Reedy
On 4/3/2017 6:09 PM, Deborah Swanson wrote: Nathan Ernst wrote, on April 03, 2017 1:59 PM I was a bit surprised when I looked at the language reference for 3.6.x. I expected there'd be a direct link to comprehensions, but there's not. ... FWIW, If one was completely new to Python, even knowin

Re: Appending data to a json file

2017-04-04 Thread Grant Edwards
On 2017-04-04, Ben Finney wrote: > Dave writes: > >> I don't care for the idea of replacing the data file for every save. > > This is the simplest implementation. It works. Can you say why you don't > care for it? After the data is read, it requires reloading the ASR33 with a fresh spool of unpu

ANN: Wing Python IDE version 6.0.4 released

2017-04-04 Thread Wingware
Hi, We've just released Wing 6.0.4 which fixes remote development to systems with Python 3, addresses problems seen when switching between remote projects and when remote host configurations are missing or invalid, fixes text drag-and-drop, solves problems with analysis of some type annotatio

Re: Appending data to a json file

2017-04-04 Thread Michael Torrie
On 04/04/2017 11:23 AM, Dave wrote: > I did. Please see the subject - it is json, not some bastardized > version of it. My fault for not seeing that! Sorry about the noise. -- https://mail.python.org/mailman/listinfo/python-list

Re: Appending data to a json file

2017-04-04 Thread Dave
On 04/04/2017 01:50 PM, Rob Gaddi wrote: On 04/04/2017 10:23 AM, Dave wrote: I don't care for the idea of replacing the data file for every save. My preference would to append to the existing data file - makes more sense. However, that is not how json works. So, I'm considering other alternat

Re: Two variable dictionary comprehension

2017-04-04 Thread Terry Reedy
On 4/3/2017 2:35 AM, Gregory Ewing wrote: Deborah Swanson wrote: Oh, come on. That's a fairly obscure citation in the docs, one that would take a good deal of experience and time reading through them to know was there, Having said that, the index of the Python docs could be improved a bit in

Re: Data exchange between python script and bash script

2017-04-04 Thread justin walters
On Tue, Apr 4, 2017 at 10:39 AM, Venkatachalam Srinivasan < venkatachalam...@gmail.com> wrote: > Hi, > > Thanks for the answer. I need bash for connecting data exchange between > two python scripts. To be more specific, data from one script has to be > passed to the another script. You are right,

Re: Data exchange between python script and bash script

2017-04-04 Thread Rhodri James
On 04/04/17 18:07, Venkatachalam Srinivasan wrote: On Tuesday, April 4, 2017 at 5:27:42 PM UTC+2, cassiope wrote: On Tue, 04 Apr 2017 08:01:42 -0700, venkatachalam.19 wrote: Hello All, I am writing a python code for processing a data obtained from a sensor. The data from sensor is obtained b

Re: Appending data to a json file

2017-04-04 Thread Rob Gaddi
On 04/04/2017 10:23 AM, Dave wrote: I don't care for the idea of replacing the data file for every save. My preference would to append to the existing data file - makes more sense. However, that is not how json works. So, I'm considering other alternatives for a data file structure. Paired da

Re: Data exchange between python script and bash script

2017-04-04 Thread Venkatachalam Srinivasan
On Tuesday, April 4, 2017 at 5:42:23 PM UTC+2, justin walters wrote: > On Tue, Apr 4, 2017 at 8:01 AM, wrote: > > > Hello All, > > > > I am writing a python code for processing a data obtained from a sensor. > > The data from sensor is obtained by executing a python script. The data > > obtained

Re: Appending data to a json file

2017-04-04 Thread Ben Finney
Dave writes: > I don't care for the idea of replacing the data file for every save. This is the simplest implementation. It works. Can you say why you don't care for it? > My preference would to append to the existing data file - makes more > sense. Can you expand on that? You haven't defined

Re: Appending data to a json file

2017-04-04 Thread Dave
On 04/04/2017 10:17 AM, Michael Torrie wrote: On 04/03/2017 11:31 PM, dieter wrote: Dave writes: I created a python program that gets data from a user, stores the data as a dictionary in a list of dictionaries. When the program quits, it saves the data file. My desire is to append the new d

Re: Data exchange between python script and bash script

2017-04-04 Thread Venkatachalam Srinivasan
On Tuesday, April 4, 2017 at 5:27:42 PM UTC+2, cassiope wrote: > On Tue, 04 Apr 2017 08:01:42 -0700, venkatachalam.19 wrote: > > > Hello All, > > > > I am writing a python code for processing a data obtained from a sensor. > > The data from sensor is obtained by executing a python script. The da

Optimize this code further

2017-04-04 Thread Ganesh Pal
Dear friends. I am trying optimize the below sample code any suggestion on this please let me know yy-1# cat file1.py #! /usr/bin/python from __future__ import absolute_import, division, print_function import os import sys import logging logging.basicConfig(stream=sys.stderr, level=

Re: Appending data to a json file

2017-04-04 Thread Robin Koch
Am 04.04.2017 um 04:59 schrieb Dave: I created a python program that gets data from a user, stores the data as a dictionary in a list of dictionaries. When the program quits, it saves the data file. My desire is to append the new data to the existing data file as is done with purely text files.

Re: Basic Nested Dictionary in a Loop

2017-04-04 Thread Ganesh Pal
Thanks Peter , Terry and others ! On Tue, Apr 4, 2017 at 12:11 PM, Peter Otten <__pete...@web.de> wrote: > Ganesh Pal wrote: > > >> > >> > >> Whenever you feel the urge to write range(len(whatever)) -- resist that > >> temptation, and you'll end up with better Python code ;) > >> > >> > > Thanks

Re: Data exchange between python script and bash script

2017-04-04 Thread justin walters
On Tue, Apr 4, 2017 at 8:01 AM, wrote: > Hello All, > > I am writing a python code for processing a data obtained from a sensor. > The data from sensor is obtained by executing a python script. The data > obtained should be further given to another python module where the > received data is used

Re: Data exchange between python script and bash script

2017-04-04 Thread Frank Miles
On Tue, 04 Apr 2017 08:01:42 -0700, venkatachalam.19 wrote: > Hello All, > > I am writing a python code for processing a data obtained from a sensor. The > data from sensor is obtained by executing a python script. The data obtained > should be further given to another python module where the r

Data exchange between python script and bash script

2017-04-04 Thread venkatachalam . 19
Hello All, I am writing a python code for processing a data obtained from a sensor. The data from sensor is obtained by executing a python script. The data obtained should be further given to another python module where the received data is used for adjusting the location of an object. For ach

Data transmission from Python script to bash script

2017-04-04 Thread venkatachalam . 19
Hello All, I am writing a python code for processing a data obtained from a sensor. The data from sensor is obtained by executing a python script. The data obtained should be further given to another python module where the received data is used for adjusting the location of an object. For ach

Re: Appending data to a json file

2017-04-04 Thread Michael Torrie
On 04/04/2017 08:19 AM, Jussi Piitulainen wrote: > The clue is on the subject line. Ahh, so it is. -- https://mail.python.org/mailman/listinfo/python-list

Re: Appending data to a json file

2017-04-04 Thread Jussi Piitulainen
Michael Torrie writes: > On 04/03/2017 11:31 PM, dieter wrote: >> Dave writes: >> >>> I created a python program that gets data from a user, stores the data >>> as a dictionary in a list of dictionaries. When the program quits, it >>> saves the data file. My desire is to append the new data to

Re: Appending data to a json file

2017-04-04 Thread Michael Torrie
On 04/03/2017 11:31 PM, dieter wrote: > Dave writes: > >> I created a python program that gets data from a user, stores the data >> as a dictionary in a list of dictionaries. When the program quits, it >> saves the data file. My desire is to append the new data to the >> existing data file as i

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-04 Thread cwrseckford
On Saturday, 1 April 2017 17:01:03 UTC+1, Steve D'Aprano wrote: > On Sat, 1 Apr 2017 12:17 pm, Rick Johnson wrote: > > > Most people just quietly change the filename and move on > > > There are over a billion people in China, almost a billion more in India, > about 140 million people in Russia,

Re: Improve Python + Influxdb import performance

2017-04-04 Thread Prathamesh
Hi Inada Thank you for your response Weblogic works on Jython 2.2.1 and I think the Python requests module requires >= python 2.6 Please correct me if I'm wrong or if there is another way to get this to work Thanks P On Monday, April 3, 2017 at 9:52:38 PM UTC+5:30, INADA Naoki wrote: > You can

EuroPython 2017: Early-bird Tickets now on sale!

2017-04-04 Thread M.-A. Lemburg
Interested in attending EuroPython? Entry tickets are now on sale and available on our website. *** Buy your EuroPython ticket *** https://ep2017.europython.eu/en/registration/buy-tickets/ Tickets for EuroPython will be sold in three phases: First, we’ll have a short ea