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 for this suggestion but for my better understanding can explain
> this further even Steve did point the same mistake.
It's
Thanks Steve for writing this, and I'll read it more carefully when my
illness gives my mind back to me.
I was actually a math major before I discovered computer science, and I
had to progress beyond machine language and assembler before I found the
subtle differences and more flexible boundaries
Gregory Ewing wrote, on Monday, April 03, 2017 4:23 PM
>
> Deborah Swanson wrote:
> > I'd
> > imagine that the old Google would have returned a good 10 pages or
> > more (probably a lot more) of urls containing the phrase "dict
> > comprehension" or "dictionary comprehension".
>
> It still does
Gregory Ewing wrote, on Monday, April 03, 2017 4:23 PM
>
> Deborah Swanson wrote:
> > All my guesses were based on the
> > single variable (the most common type) examples I found. I just
didn't
> > think of putting a colon after 'label', and found nothing to suggest
> > that's what I should do.
You _can_ just extend a JSON file without loading it, but it will not be
"fun".
Say the JSON file contains a top-level array. The final significant
character in it would be a ']'. So, you can read just a reasonably-sized
block from the end of the file, find the location of the final ']',
overwrite
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 is done with purely text files.
Usually, you c
Kenneth Buckler writes:
> I'm working on a Python 2.7.13 (Win x64) script to verify SSL certificates,
> and alert for problems. Specifically, I'm looking to return the date the
> cert expires or did expire. However, I'm running into an issue where the
> script will return information only if the c
Version 2 of my natural language steganographical scheme
WORDLISTTEXTSTEGANOGRAPHY
is available on my home page http://mokkong-shen.privat.t-online.de ,
together with
a few other cryptological and steganographical software of mine. See update
notes in it for the differences to earlier versions
Thank you Nate, for all these sources to study. Python was very easy for
me to learn in 2 online courses, but it's been all uphill since then.
I've learned a lot and for that I'm grateful, but there's so much
farther to go.
I've appreciated our discussions, but I am in fact a very sick person
and
On Tue, Apr 4, 2017 at 1:45 AM, Dennis Lee Bieber wrote:
>
> C:\Users\Wulfraed>assoc .py
> .py=Python.File
>
> C:\Users\Wulfraed>ftype python.file
> python.file="C:\Python27\python.exe" "%1" %*
The Windows shell stores the user file-association choice in
HKCU\Software\Microsoft\Windows\CurrentVer
On 04/03/2017 08:59 PM, Dave wrote:
> 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 tex
On Mon, Apr 3, 2017 at 5:50 PM, Deborah Swanson
wrote:
> Ah, but did you actually try to use the proposed solutions on the two
> stackoverflow pages? It's been several weeks now, but I did, and neither
> of those two examples fit my situation, which is why I ended up writing
> my own, and unsatisf
On Sunday, April 2, 2017 at 3:49:43 PM UTC-5, Gene Heskett wrote:
> On Sunday 02 April 2017 12:26:40 Steve D'Aprano wrote:
> > On Sun, 2 Apr 2017 04:41 pm, Terry Reedy wrote:
> > > On 4/1/2017 12:00 PM, Steve D'Aprano wrote:
> > > >
> > > > example of the Ugly American.
> > >
> > > As an American
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. However, I can't
find a way to do
On Tue, Apr 4, 2017 at 10:13 AM, Rick Johnson
wrote:
> D'Aprano, are you still stewing because Donald J Trump
> spanked Hillary's jumbo sized bottom like an unruly
> stepchild? You poor widdle partisian hack. I almost feel
> sorry for you.
>
> [snip massively long political rant]
Alright, can the
On Mon, Apr 3, 2017 at 8:24 PM Dennis Lee Bieber
wrote:
> On Mon, 3 Apr 2017 11:48:38 -0700, "Deborah Swanson"
> declaimed the following:
>
> >But, if Larry Page and Sergey Brin could tinker around in their dorm
> >rooms (or wherever they lived then) and they made the first Google (the
> >first
On Tue, 4 Apr 2017 03:27 am, Deborah Swanson wrote:
> I'll admit that both dictionaries and comprehensions are still a little
> bit fuzzy to me, especially when I get away from the common usages. This
> could be a good exercise to clarify some of the fuzzy areas.
As far as comprehensions go, how
On Sunday, April 2, 2017 at 11:26:50 AM UTC-5, Steve D'Aprano wrote:
On Sun, 2 Apr 2017 04:41 pm, Terry Reedy wrote:
On 4/1/2017 12:00 PM, Steve D'Aprano wrote:
example of the Ugly American.
As an American I resent your promotion and perpetuation of an ugly
ethno-centric stereotype.
I'm
On Sunday, April 2, 2017 at 11:26:50 AM UTC-5, Steve D'Aprano wrote:
> On Sun, 2 Apr 2017 04:41 pm, Terry Reedy wrote:
> > On 4/1/2017 12:00 PM, Steve D'Aprano wrote:
> >
> > > example of the Ugly American.
> >
> > As an American I resent your promotion and perpetuation of
> > an ugly ethno-centr
On Tue, Apr 4, 2017 at 8:31 AM, wrote:
> Hi Chris,
>
>Really! :) So I can type pip install requests at the prompt: C:\Program
> Files\Python 2.7.12>pip install requests
>or at C:\>pip install requests
>
>And the modules would be installed either way?
>
>Sorry I am also a newbie a
On Saturday, April 1, 2017 at 9:32:17 PM UTC-5, MRAB wrote:
> Sometimes he mentions MUDs, sometimes he mentions Pike, but at least he
> doesn't rant.
I have not even _begun_ to rant. Yet...
--
https://mail.python.org/mailman/listinfo/python-list
Deborah Swanson wrote:
I'd
imagine that the old Google would have returned a good 10 pages or more
(probably a lot more) of urls containing the phrase "dict comprehension"
or "dictionary comprehension".
It still does, as far as I can see. I just googled for "dict
comprehension", and the vast ma
Deborah Swanson wrote:
But, if Larry Page and Sergey Brin could tinker around in their dorm
rooms (or wherever they lived then) and they made the first Google (the
first search engine?)
It wasn't the first web search engine. But it was the first
one that not only worked, but *kept* working as
Deborah Swanson wrote:
All my guesses were based on the
single variable (the most common type) examples I found. I just didn't
think of putting a colon after 'label', and found nothing to suggest
that's what I should do.
Hmmm, I'm not sure what the docs could do to make that any
clearer. The ke
Deborah Swanson wrote:
I'll admit that both dictionaries and comprehensions are still a little
bit fuzzy to me, especially when I get away from the common usages. This
could be a good exercise to clarify some of the fuzzy areas.
If you're fuzzy about dictionaries in general, it might be a
good
No worries, Deborah.
Python is by most measurements a relatively easy/simple language to learn,
but there are always the dusty corners. If you've not already, I recommend
going through the online Python tutorial in it's entirety (
https://docs.python.org/3/tutorial/index.html).
After that, learn
On Monday, April 3, 2017 at 2:02:30 PM UTC-7, Pauline wrote:
> Hi,
>
> I am a newbie to Python. I am using Python 2.7.12. I want to install the
> modules of requests and openpyxl using pip. In the Internet, people only
> said pip install requests, but they do not say in which directory. I
Hi Pauline,
I was able to infer you're on Windows, but not which version. Try
right-clicking on the start menu to start a command prompt as an
administrator (I'm not sure that was available in Windows 7, and I don't
have access to a Win7 box currently to verify). Failing that, you should be
able t
On Tue, Apr 4, 2017 at 8:14 AM, wrote:
> Hi Nate,
>
> Well, I didn't tell you I am on Windows 7. When I went to cmd, it was
> C:\Users\myname. Then I navigated to where my Python was installed C:\Program
> Files\Python 2.7.12>
>
> Do I type pip install requests at the end of the arrow, or
On Monday, April 3, 2017 at 2:02:30 PM UTC-7, Pauline wrote:
> Hi,
>
> I am a newbie to Python. I am using Python 2.7.12. I want to install the
> modules of requests and openpyxl using pip. In the Internet, people only
> said pip install requests, but they do not say in which directory. I
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.
>
> You have to know what you're looking for:
>
> 6.2.5: List Displays
> 6.2.6: Set Displays
>
If you've installed into Program Files, then you're on Windows, and you've
installed for all users. Start a command prompt by right-clicking on the
start icon, then selecting "Command Prompt (Admin)". This should work on
Windows 8.x and Windows 10. Windows 7, you may need to navigate through
Progra
Jerry Hill wrote, on April 03, 2017 1:48 PM
>
> On Mon, Apr 3, 2017 at 10:30 AM, Deborah Swanson
> wrote:
> > Regular updates as the docs are updated would be a good
> idea too. It's
> > obvious that today's Google isn't up to it, although it
> occurs to me
> > that I haven't tried Google's
On Monday, April 3, 2017 at 2:02:30 PM UTC-7, Pauline wrote:
> Hi,
>
> I am a newbie to Python. I am using Python 2.7.12. I want to install the
> modules of requests and openpyxl using pip. In the Internet, people only
> said pip install requests, but they do not say in which directory. I
Hi Pauline,
It depends largely on whether you want to (and have sufficient permissions)
to install for all users or just yourself.
If, on *nix, you're installing site-wide (for all users), typically you'd
do: "sudo pip install " (for python 2) or "sudo pip3 install
" (for python 3). If you're in
Hi,
I am a newbie to Python. I am using Python 2.7.12. I want to install the
modules of requests and openpyxl using pip. In the Internet, people only said
pip install requests, but they do not say in which directory. I only found one
that said install in the script directory within Pytho
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.
You have to know what you're looking for:
6.2.5: List Displays
6.2.6: Set Displays
6.2.7: Dictionary Displays
And, then, click on the appropriate eleme
On Mon, Apr 3, 2017 at 10:30 AM, Deborah Swanson
wrote:
> Regular updates as the docs are updated would be a good idea too. It's
> obvious that today's Google isn't up to it, although it occurs to me
> that I haven't tried Google's site search on python.org.
So, when you search google for the phr
Python 3.4.2
Tkinter 8.6
GCC 4.9.1 on Linux
I am working on a gui program using Tkinter. The program will
have a feature to restart as root. I am testing different gui
front-ends from a terminal to raise privileges and I want to
be able to use as many as possible for obvious reasons. Gksu,
kdesu
Rob Gaddi wrote, on April 03, 2017 10:38 AM
>
> On 04/03/2017 10:27 AM, Deborah Swanson wrote:
> > Dennis Lee Bieber wrote, on April 03, 2017 9:35 AM
> >>
> >> On Mon, 3 Apr 2017 07:30:40 -0700, "Deborah Swanson"
> >> declaimed the following:
> >>
> >>>
> >>> Clearly there's more to be found in
On Mon, 3 Apr 2017 08:31 am, Terry Reedy wrote:
[...]
> I refrained because it would be off-topic and a diversion from my point:
> all bigotry is inappropriate here on this list,
Indeed it is not appropriate. But calling out bigotry is not itself bigotry.
I hope you agree with that.
If not, th
On 04/03/2017 10:27 AM, Deborah Swanson wrote:
Dennis Lee Bieber wrote, on April 03, 2017 9:35 AM
On Mon, 3 Apr 2017 07:30:40 -0700, "Deborah Swanson"
declaimed the following:
Clearly there's more to be found in nooks, crannies and
byways in the
docs than you'll get to from the given poin
Dennis Lee Bieber wrote, on April 03, 2017 9:35 AM
>
> On Mon, 3 Apr 2017 07:30:40 -0700, "Deborah Swanson"
> declaimed the following:
>
> >
> >Clearly there's more to be found in nooks, crannies and
> byways in the
> >docs than you'll get to from the given pointers in the
> index. Maybe it
On Monday, April 3, 2017 at 9:52:38 PM UTC+5:30, INADA Naoki wrote:
> You can reuse connection, instead of creating for each request. (HTTP
> keep-alive).
>
> On Tue, Apr 4, 2017 at 1:11 AM, Prathamesh
> wrote:
> > Hello World
> >
> > The following script is an extract from
> >
> > https://githu
On Mon, Apr 3, 2017 at 7:43 PM, Chris Angelico wrote:
> Here's a counter-example that supports the current behaviour:
>
> >>> from enum import IntFlag, auto
> >>> class Spam(IntFlag):
> ... FOO = auto()
> ... BAR = auto()
> ... FOOBAR = FOO | BAR
> ... SPAM = auto()
> ... HAM
On Tue, Apr 4, 2017 at 2:29 AM, Ethan Furman wrote:
> It this point I do not. If you can give us an example Enum and why it's
> necessary to be built like that I might be swayed -- although the odds are
> good that the change will go into aenum instead (it's already a mess with
> the 2.7 compatib
On 04/03/2017 01:53 AM, Oren Ben-Kiki wrote:
On Mon, Apr 3, 2017 at 11:03 AM, Ethan Furman wrote:
Python code is executed top-down. First FOO, then BAR, then BAZ. It is not
saved up and executed later in random
order. Or, put another way, the value was appropriate when it was chosen -- it
On Tue, Apr 4, 2017 at 12:34 AM, Paul Moore wrote:
> On Monday, 3 April 2017 15:10:12 UTC+1, Chris Angelico wrote:
>> You're getting HTTP/1.1 requests. Maybe you need to send a
>> "Connection: close" header to tell the browser to leave you be?
>
> That sounds possible - I don't really know enoug
You can reuse connection, instead of creating for each request. (HTTP
keep-alive).
On Tue, Apr 4, 2017 at 1:11 AM, Prathamesh wrote:
> Hello World
>
> The following script is an extract from
>
> https://github.com/RittmanMead/obi-metrics-agent/blob/master/obi-metrics-agent.py
>
> <>
>
> import ca
I'm working on a Python 2.7.13 (Win x64) script to verify SSL certificates,
and alert for problems. Specifically, I'm looking to return the date the
cert expires or did expire. However, I'm running into an issue where the
script will return information only if the certificate is valid.
If the cert
Hello World
The following script is an extract from
https://github.com/RittmanMead/obi-metrics-agent/blob/master/obi-metrics-agent.py
<>
import calendar, time
import sys
import getopt
print '---'
# Check the arguments to this script are as expected.
# argv[
On Monday, 3 April 2017 15:10:12 UTC+1, Chris Angelico wrote:
> You're getting HTTP/1.1 requests. Maybe you need to send a
> "Connection: close" header to tell the browser to leave you be?
That sounds possible - I don't really know enough about HTTP to even know that
was a thing, so I'm not surp
Gregory Ewing wrote, on April 02, 2017 11:35 PM
>
> 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,
>
> You seemed to know that there was something
On Mon, Apr 3, 2017 at 11:56 PM, Paul Moore wrote:
> On Monday, 3 April 2017 14:20:43 UTC+1, Paul Moore wrote:
>> On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote:
>> > It should service the request and return to the serve_forever() loop.
>> > Do you see a line logged for each request, l
On Monday, 3 April 2017 14:20:43 UTC+1, Paul Moore wrote:
> On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote:
> > It should service the request and return to the serve_forever() loop.
> > Do you see a line logged for each request, like "[IP] - - [date] "GET
> > ..."?
>
> Yes, I see that a
On Mon, Apr 3, 2017 at 1:20 PM, Paul Moore wrote:
> On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote:
>> It should service the request and return to the serve_forever() loop.
>> Do you see a line logged for each request, like "[IP] - - [date] "GET
>> ..."?
>
> Yes, I see that and the page
We are starting ticket sales tomorrow and, as is tradition, we have
allocated a number of tickets to be sold at very low rates - in fact
you can save between 40-50% on these early-bird rates, compared to the
regular ticket prices.
Sales at the early-bird rate will open tomorrow, April 4th,
On 01/04/17 16:15, Mario R. Osorio wrote:
I'm not in the business of starting an argument about best/worse newsreader,
Ammammata, but could you please recommend a few?
Mozilla Thunderbird works very well. Spam is close to nothing using this
free nntp server: news.aioe.org
Regards
--
Chol
On Monday, 3 April 2017 14:00:18 UTC+1, eryk sun wrote:
> It should service the request and return to the serve_forever() loop.
> Do you see a line logged for each request, like "[IP] - - [date] "GET
> ..."?
Yes, I see that and the page is served.
>py .\example.py
Serving HTTP on port 8000...
12
On Mon, Apr 3, 2017 at 12:34 PM, Paul Moore wrote:
> On Monday, 3 April 2017 13:23:11 UTC+1, eryk sun wrote:
>> It works for me when run from a command prompt in Windows 10.
>> serve_forever() uses select() with a timeout of 0.5s, so it doesn't
>> block the main thread.
>
> Odd. For me, it doesn
I hear people say it like the plural of "panda", and others as "panduss". Is
there a correct way?
j
--
https://mail.python.org/mailman/listinfo/python-list
On Monday, 3 April 2017 13:23:11 UTC+1, eryk sun wrote:
> It works for me when run from a command prompt in Windows 10.
> serve_forever() uses select() with a timeout of 0.5s, so it doesn't
> block the main thread.
Odd. For me, it doesn't work (Windows 7, but I can't see why that would affect
it
On Mon, Apr 3, 2017 at 9:08 AM, Paul Moore wrote:
> I know I've seen this before, but for the life of me I can't find any
> reference.
>
> If I write a simple web server using wsgiref, something like
>
> from wsgiref.simple_server import make_server, demo_app
>
> with make_server('', 800
Il giorno Sat 01 Apr 2017 09:15:41p, *Mario R. Osorio* ha inviato su
comp.lang.python il messaggio
news:d0e9d036-2924-4c2c-99b1-0d8cb02b9...@googlegroups.com. Vediamo cosa
ha scritto:
> I'm not in the business of starting an argument about best/worse
> newsreader, Ammammata, but could you please
I know I've seen this before, but for the life of me I can't find any reference.
If I write a simple web server using wsgiref, something like
from wsgiref.simple_server import make_server, demo_app
with make_server('', 8000, demo_app) as httpd:
print("Serving HTTP on port 8000...
Gregory Ewing wrote:
>
> Part of being a good programmer is knowing how to track
> down the information you need!
>
A very *large* part of it! :-)
> Having said that, the index of the Python docs could be
> improved a bit in this area -- currently it only mentions
> "list" under "comprehensio
[This announcement is in German since it targets a local user group
meeting in Düsseldorf, Germany]
ANKÜNDIGUNG
Python Meeting Düsseldorf
http://pyddf.de/
Ein Tref
On Mon, Apr 3, 2017 at 11:03 AM, Ethan Furman wrote:
> Python code is executed top-down. First FOO, then BAR, then BAZ. It is
> not saved up and executed later in random order. Or, put another way, the
> value was appropriate when it was chosen -- it is not the fault of auto()
> that the user
Hello,
I have written a Python package to read from and write to a serial
device that uses short telegrams to communicate with sensors and
actuators. My classes include one to model the transceiver (it
establishes the serial connection using
serial.aio.create_serial_connection) and one for the tel
On 04/02/2017 09:49 PM, Oren Ben-Kiki wrote:
The current behavior of `auto` is to pick a value which is one plus the
previous value.
Starting with 1 if no previous value exists.
It would probably be better if `auto` instead picked a value that is not
used by any named member (either the mini
70 matches
Mail list logo