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 called a "dict
comprehension". Googling for "python 3 dict comprehension"
Iranna Mathapati writes:
> How to fix it and now i got below error for same script
Fixing "timeout" problems is (usually) not a Python question.
A "timeout" can have various reasons:
* you make something fundamentally wrong - i.e. try to connect
to something which is inaccessible (e.g. by "
While "the current behaviour is compliant with what the docs say" is true,
saying "as such, I would be disinclined to change the code" misses the
point.
The current documentation allows for multiple behaviors. The current
implementation has an chosen to add an arbitrary undocumented restriction
on
On Mon, Apr 3, 2017 at 2:49 PM, Oren Ben-Kiki wrote:
> "If the exact value is unimportant you may use auto instances and an
> appropriate value will be chosen for you."
>
> Choosing a value that conflicts with BAZ in above cases doesn't seem
> "appropriate" for a value that is "unimportant".
>
> T
Ben Finney wrote. on April 02, 2017 7:41 PM
>
> "Deborah Swanson" writes:
>
> > Chris Angelico wrote, on April 02, 2017 6:37 PM
> > >
> > > On Mon, Apr 3, 2017 at 11:26 AM, Deborah Swanson
> > > > Maybe I'm having another "dumb day" [.]
> >
> > Well, wouldncha know it, I never tried using a col
Hello,
I am working with Python 3.6. I’ve been trying to figure out a solution to my
question for about 40 hrs with no success and hundreds of failed attempts.
Essentially, I have bitten off way more than I can chew with processing this
file. Most of what follows, is my attempt to inform as
The current behavior of `auto` is to pick a value which is one plus the
previous value.
It would probably be better if `auto` instead picked a value that is not
used by any named member (either the minimal unused value, or the minimal
higher than the previous value). That is, in this simple case:
"Deborah Swanson" writes:
> Chris Angelico wrote, on April 02, 2017 6:37 PM
> >
> > On Mon, Apr 3, 2017 at 11:26 AM, Deborah Swanson
> > > Maybe I'm having another "dumb day" […]
>
> Well, wouldncha know it, I never tried using a colon. That's what I
> get for just trying to guess.
Yes, guessi
Ben Finney wrote, on April 02, 2017 6:38 PM
>
> "Deborah Swanson" writes:
>
> > It seems like this should be easy to rewrite as a dict
> comprehension:
> >
> > records_idx = {}
> > for idx, label in enumerate(records[0]):
> > records_idx[label] = idx
>
> How about this::
>
>
Chris Angelico wrote, on April 02, 2017 6:37 PM
>
> On Mon, Apr 3, 2017 at 11:26 AM, Deborah Swanson
> wrote:
> > It seems like this should be easy to rewrite as a dict
> comprehension:
> >
> > records_idx = {}
> > for idx, label in enumerate(records[0]):
> > records_idx[label]
"Deborah Swanson" writes:
> It seems like this should be easy to rewrite as a dict comprehension:
>
> records_idx = {}
> for idx, label in enumerate(records[0]):
> records_idx[label] = idx
How about this::
records_idx = {
label: idx
for (idx, label) in enumer
On Mon, Apr 3, 2017 at 11:26 AM, Deborah Swanson
wrote:
> It seems like this should be easy to rewrite as a dict comprehension:
>
> records_idx = {}
> for idx, label in enumerate(records[0]):
> records_idx[label] = idx
>
> Maybe I'm having another "dumb day", or maybe I've just bee
It seems like this should be easy to rewrite as a dict comprehension:
records_idx = {}
for idx, label in enumerate(records[0]):
records_idx[label] = idx
Maybe I'm having another "dumb day", or maybe I've just been struggling
with this (larger) problem for too long, but eveything I
On 04/02/2017 06:00 PM, Alex Kaye wrote:
> Michael, Thanks for your comment.
>
> However, If one derails from the core subject
>
> they need to be in another stream. Alex
I think you'll find that the subject line was changed by Ben Finney to
reflect the new direction he was taking it, which is
On 04/02/2017 05:10 PM, Ben Finney wrote:
>
> Ideas are not people, and are not innate to the person who holds them.
> An idea is not deserving of respect; that respect must not be assumed,
> it must be earned.
>
> More importantly, ideas inform behaviour. That is what makes robust
> criticism of
Terry Reedy writes:
> On 4/2/2017 12:26 PM, Steve D'Aprano wrote:
> > Not all Americans, perhaps not even a majority or a plurality, are Ugly
> > Americans, but there are enough of them to screw it up for everyone else.
>
> Shall we discuss Ugly Australians, or whatever the appropriate epithet
>
On 4/2/2017 1:59 PM, Ganesh Pal wrote:
> 'someone' 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 th
On 4/2/2017 12:26 PM, 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 glad you didn't try to des
On Sunday, April 2, 2017 at 1:08:17 AM UTC+1, Robert L. wrote:
> I don't believe in western morality, i.e. don't kill civilians or children
> The only way to fight a moral war is the Jewish way: Destroy their holy sites.
> Kill men, women, and children (and cattle). --- Rabbi Manis Friedman
>
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 resent your promotion and perpetuation of an ugly
> > ethno-centric stereotype.
>
> I
On 1/8/2017, Steven D'Aprano wrote:
> Suppose you have an expensive calculation that gets used two or
> more times in a loop. The obvious way to avoid calculating it
> twice in an ordinary loop is with a temporary variable:
>
> result = []
> for x in data:
> tmp = expensive_calculation(x)
>
Hello,
�
I have a tcp server coded with python and my packets include a 2 bytes header
which is just the length of the following data. The problem is how can I be
sure I received 2 bytes and not just one byte. In Qt, I use bytesAvailable
function. However, here I just use sock.recv(2) but it can
Hello! I'm happy to announce I revived development of Cheetah.
Unfortunately I have to fork the project.
I'm pleased to announce version 3.0.0a1, the first alpha of the upcoming
release of branch 3.0 of CheetahTemplate3.
What's new in CheetahTemplate3
==
Contributors
>
>
> 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.
>
> Instead of artificially blow
On Sun, Apr 2, 2017 at 10:35 PM, Steve D'Aprano
wrote:
>
> Why is payment a string?
>
> Yes it should be int
>
> > The value salary3 ,salary4,salary4 is to be generated in the loop . Iam
> > trying to optimize the above code , by looping as shown below
>
> In the above example, you have strings
On Mon, 3 Apr 2017 02:13 am, Ganesh Pal wrote:
> Dear Python friend
>
>
> I have a nested data dictonary in the below format and I need to store
> 1000 of entries which are in teh below format
>
>
X['emp_01']['salary3'] = dict(sex="f", status="single", exp="4",
> grade="A",payment="200"
Ganesh Pal wrote:
> Dear Python friend
>
>
> I have a nested data dictonary in the below format and I need to store
> 1000 of entries which are in teh below format
>
>
X['emp_01']['salary3'] = dict(sex="f", status="single", exp="4",
> grade="A",payment="200")
X['emp_01']['salary4']
Hi All,
I was trying to build a VIM like shortcuts in windows. For example,
IF i press CAPSLOCK & h: It should "{Left}" move one to left. If CAPSLOCK &
b: It should "{Ctrl Down}{Left}{Ctrl Up}" move one word left etc.
I was successful in sending the key event. I used libraries like,
1. pynput
2
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 glad you didn't try to describe it as a *unfair* or *unjustifie
Dear Python friend
I have a nested data dictonary in the below format and I need to store
1000 of entries which are in teh below format
>>> X['emp_01']['salary3'] = dict(sex="f", status="single", exp="4",
grade="A",payment="200")
>>> X['emp_01']['salary4'] = dict(sex="f", status="single", exp
On Sun, Apr 2, 2017 at 9:12 PM, bartc wrote:
> But people, when unrestrained, will /always/ want to do something that may
> not be practical. For example, why bother with the separate concepts
> 'filename' and 'file'; just have the file contents /as/ the filename! If
> there are no limits on how l
On 01/04/2017 22:35, Marko Rauhamaa wrote:
Chris Angelico :
there is no way within Python to have a string that can represent two
strings, which is what directory separators do.
Really? Try:
>>> repr(("a", "b"))
"('a', 'b')"
There! A string that represents two strings.
Note, however,
Christian Gollwitzer :
> Am 01.04.17 um 19:38 schrieb Steve D'Aprano:
>> Next: convince keyboard manufacturers to move the caret from SHIFT-6
>> to a plain, unshifted key. Buggared if I'm going to hit shift every
>> time I want to use an absolute path...
>
> ...which is reality for a lot more peop
Am 01.04.17 um 19:38 schrieb Steve D'Aprano:
^home^steve^document.txt
I'm sure I'd get used to it in a few years...
Next: convince keyboard manufacturers to move the caret from SHIFT-6 to a
plain, unshifted key. Buggared if I'm going to hit shift every time I want
to use an absolute path...
On Sun, Apr 2, 2017 at 4: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.
There are ugly Americans and there are non-ugly Americans. Rick
35 matches
Mail list logo