Dear Community,
For the PythonFOSDEM [1] on 4th and 5th February in Belgium, I would
like to present some slides with the Python events around the World.
Based on https://python.org/events, I have noted that there are missing
events, for example:
* PyCon Otto: Italy
* PyCon UK: United Kingd
Op 09-01-17 om 07:58 schreef Deborah Swanson:
> Peter Otten wrote, on January 08, 2017 5:21 AM
>> Deborah Swanson wrote:
>>
>>> Peter Otten wrote, on January 08, 2017 3:01 AM
>>
>> Personally I would recommend against mixing data (an actual location)
> and
>> metadata (the column name,"Location"
Op 09-01-17 om 07:58 schreef Deborah Swanson:
> Peter Otten wrote, on January 08, 2017 5:21 AM
>> Deborah Swanson wrote:
>>
>>> Peter Otten wrote, on January 08, 2017 3:01 AM
>>
>> Personally I would recommend against mixing data (an actual location)
> and
>> metadata (the column name,"Location"
On 09.01.17 05:53, 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)
result
Antoon Pardon wrote, on January 09, 2017 2:14 AM
> > 1) I have a section that loops through the sorted data, compares two
> > adjacent rows at a time, and marks one of them for deletion if the
> > rows are identical.
> >
> > I'm using
> >
> > for i in range(len(records)-1):
> > r1 = records[
Steven D'Aprano writes:
> [(expensive_calculation(x), expensive_calculation(x) + 1) for x in data]
def memoize(f):
cache = {}
def m(x):
if x in cache:
return cache[x]
a = f(x)
cache[x] = a
r
Serhiy Storchaka writes:
> gen = (expensive_calculation(x) for x in data)
> result = [(tmp, tmp + 1) for tmp in gen]
result = [(tmp, tmp+1) for tmp in map(expensive_calculation, data)]
--
https://mail.python.org/mailman/listinfo/python-list
Antoon Pardon wrote, on January 09, 2017 2:35 AM
> If I understand correctly you want something like:
>
> records.sort(key = lamda rec: rec.xx)
>
> AKA
>
> from operator import attrgetter
> records.sort(key = attrgetter('xx'))
>
> or maybe:
>
> records.sort(key = lambda rec:
On Mon, 9 Jan 2017 09:57 pm, Deborah Swanson wrote:
[...]
> I think you are replying to my question about sorting a namedtuple, in
> this case it's called 'records'.
>
> I think your suggestion works for lists and tuples, and probably
> dictionaries. But namedtuples doesn't have a sort function.
Hello
Trying to learn python on a laptop. Was successful for awhile then...
Had a 'subprocess startup error'
'IDLE's subprocess didn't make connection. Either IDLE can't start subprocess
or personal firewall software is blocking the connection '
Doesn't appear to be firewall and I uninstall
On 2017-01-09 02:46, Paul Rubin wrote:
> > gen = (expensive_calculation(x) for x in data)
> > result = [(tmp, tmp + 1) for tmp in gen]
>
> result = [(tmp, tmp+1) for tmp in map(expensive_calculation, data)]
As charmingly expressive as map() is, the wildly different behavior in
py3 (it's a gener
Steve D'Aprano wrote, on January 09, 2017 3:40 AM
>
> On Mon, 9 Jan 2017 09:57 pm, Deborah Swanson wrote:
>
> [...]
> > I think you are replying to my question about sorting a
> namedtuple, in
> > this case it's called 'records'.
> >
> > I think your suggestion works for lists and tuples, and
On 05/01/17 02:53, Deborah Swanson (Deborah Swanson) wrote:
Rhodri James wrote, on January 05, 2017 3:53 AM
On 05/01/17 04:52, Deborah Swanson wrote:
My original question was in fact whether there was a way to make
clickable hyperlinks in a console. I was persuaded after about 10
replies that
Rhodri James wrote, on January 09, 2017 4:28 AM
>
> Nope. PyCharm outputs text to the console that the console
> chooses to
> interpret as a link and makes clickable. As Stephen pointed
> out right
> back at the beginning of this thread, printing the textual
> string that
> is a URL could
On Monday, January 9, 2017 at 5:54:15 PM UTC+5:30, Tim Chase wrote:
> On 2017-01-09 02:46, Paul Rubin wrote:
> > > gen = (expensive_calculation(x) for x in data)
> > > result = [(tmp, tmp + 1) for tmp in gen]
> >
> > result = [(tmp, tmp+1) for tmp in map(expensive_calculation, data)]
>
> As cha
Hello, I am trying to make a code wich compares between 2 or several sequences
(lists). It compares every element in a list with another list elements. For
example, if we have a list_a=["a","b","c","d"] and list_b=["a","b"] I want to
obtain a new list_c containing elements that match between the
Op 09-01-17 om 04:53 schreef Steven D'Aprano:
> 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_ca
José Manuel Suárez Sierra wrote, on January 09, 2017 5:09 AM
>
> Hello, I am trying to make a code wich compares between 2 or
> several sequences (lists). It compares every element in a
> list with another list elements. For example, if we have a
> list_a=["a","b","c","d"] and list_b=["a","b"]
José Manuel Suárez Sierra wrote:
> Hello,
Welcome!
> I am trying to make a code wich compares between 2 or several
> sequences (lists). It compares every element in a list with another list
> elements. For example, if we have a list_a=["a","b","c","d"] and
> list_b=["a","b"] I want to obtain a
El lunes, 9 de enero de 2017, 14:09:09 (UTC+1), José Manuel Suárez Sierra
escribió:
> Hello, I am trying to make a code wich compares between 2 or several
> sequences (lists). It compares every element in a list with another list
> elements. For example, if we have a list_a=["a","b","c","d"] an
On 2017-01-09 05:00, Deborah Swanson wrote:
> Code does in fact have the power to control what happens
> in the console. How do you think Linux does it on their terminals
> with clickable links? Granted, the code may have to specify
> parameters for a particular console, but I certainly wasn't aski
On 2017-01-08 22:58, Deborah Swanson wrote:
> 1) I have a section that loops through the sorted data, compares two
> adjacent rows at a time, and marks one of them for deletion if the
> rows are identical.
>
> I'm using
>
> for i in range(len(records)-1):
> r1 = records[i]
> r2 = records
El lunes, 9 de enero de 2017, 14:09:09 (UTC+1), José Manuel Suárez Sierra
escribió:
> Hello, I am trying to make a code wich compares between 2 or several
> sequences (lists). It compares every element in a list with another list
> elements. For example, if we have a list_a=["a","b","c","d"] an
Deborah Swanson wrote:
> Even better, to get hold of all the records with the same Description as
> the current row, compare them all, mark all but the different ones for
> deletion, and then resume processing the records after the last one?
When you look at all fields for deduplication anyway th
On 09/01/17 13:53, Tim Chase wrote:
On 2017-01-09 05:00, Deborah Swanson wrote:
The console is a dead thing, it has no mind or soul to choose
anything. Surely an educated person would know that.
Pretty much every quality system administrator I know uses the
terminal. Just about all of the bes
FYI
Turns out I was saving my practice exercises as files (.py) under the python
directory which conflicted with the running of Idle. All cleared up now.
Sent from my iPad
> On 9 Jan 2017, at 12:16, Gretchen Hasselbring
> wrote:
>
> Hello
>
> Trying to learn python on a laptop. Was succes
On 1/9/2017 6:48 AM, Gretchen Hasselbring wrote:
Hello
Trying to learn python on a laptop. Was successful for awhile then...
Had a 'subprocess startup error'
'IDLE's subprocess didn't make connection. Either IDLE can't start subprocess
or personal firewall software is blocking the connectio
José Manuel Suárez Sierra wrote:
> This is the traceback:
> line 18, in
> for transf2[j] in transf2:
> IndexError: list assignment index out of range
>
> If I have initialized j=0 (such as i) why does it not work?
A for loop
for x in y:
...
sequentually assigns every value in y to x. So wi
Gretchen Hasselbring wrote:
> FYI
>
> Turns out I was saving my practice exercises as files (.py) under the
> python directory which conflicted with the running of Idle. All cleared
> up now.
Thanks for the update. Can you tell which file you shadowed to cause the
error? Perhaps even if the un
Hi,
I have a C++ module that I am compiling to use inside of my Python
installation under Mac OS.
If I compile & link it against a Framework enabled Python installation, it
works fine, but if I compile & link it against a *non* enabled Framework
installation that we use for distribution, I simpl
On Monday, January 9, 2017 at 2:22:19 PM UTC, Tim Chase wrote:
> On 2017-01-08 22:58, Deborah Swanson wrote:
> > 1) I have a section that loops through the sorted data, compares two
> > adjacent rows at a time, and marks one of them for deletion if the
> > rows are identical.
> >
> > I'm using
>
Thank you for your responses. The file I think is responsible was called
types.py
Sent from my iPad
> On 9 Jan 2017, at 16:11, Peter Otten <__pete...@web.de> wrote:
>
> Gretchen Hasselbring wrote:
>
>> FYI
>>
>> Turns out I was saving my practice exercises as files (.py) under the
>> pyt
On 2017-01-09 04:59, Rustom Mody wrote:
> What happens when the expensive is on an inner generator?
> Something like:
>
> [expensive₂(y) for x in data for y in foo(x)]
>
> [The ₂ representing the 2 or more occurrences in Steven's eg]
Well, if I understand your question correctly, the goal would
On 01/09/2017 06:00 AM, Deborah Swanson wrote:
> Rhodri James wrote, on January 09, 2017 4:28 AM
>>
>> Nope. PyCharm outputs text to the console that the console
>> chooses to
>> interpret as a link and makes clickable. As Stephen pointed
>> out right
>> back at the beginning of this thread,
Antonio Caminero Garcia wrote:
> On Friday, January 6, 2017 at 6:04:33 AM UTC-8, Peter Otten wrote:
>> Example: you are looking for the minimum absolute value in a series of
>> integers. As soon as you encounter the first 0 it's unnecessary extra
>> work to check the remaining values, but the buil
On Mon, Jan 9, 2017 at 1:02 PM, Gilmeh Serda
wrote:
> On Mon, 09 Jan 2017 05:08:51 -0800, José Manuel Suárez Sierra wrote:
>
>> elements. For example, if we have a list_a=["a","b","c","d"] and
>> list_b=["a","b"] I want to obtain a new list_c containing elements that
>> match between these lists (
On 01/09/2017 10:27 AM, Michael Torrie wrote:
>> You can use tkinter (code
>> in a program) to make clickable links in the console,
>
> Unless you're talking about an implementation of a console or terminal
> emulator in tkinter, this is incorrect. Tkinter does not do anything
> with standard ou
On Sunday, January 8, 2017 at 7:53:37 PM UTC-8, 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
Am 09.01.17 um 04:53 schrieb Steven D'Aprano:
Or do you? ... no, you don't!
[(tmp, tmp + 1) for x in data for tmp in [expensive_calculation(x)]]
I can't decide whether that's an awesome trick or a horrible hack...
I think this is quite clear, and a useful feature, only that Python
makes it u
>> elements. For example, if we have a list_a=["a","b","c","d"] and
>> list_b=["a","b"] I want to obtain a new list_c containing elements that
>> match between these lists (a and b here),
>Perhaps this might work:
list(set(list_a).intersection(set(list_b)))
>['a', 'b']
>>> list_a={"a","b","
Thanks Stephane,
Kiwi PyCon 2017 will be in Auckland, New Zealand in September - exact
dates and location not yet determined. I'll submit it when they are.
Cheers,
Danny
On Mon, Jan 9, 2017 at 10:54 PM, Stephane Wirtel via PSF-Community
wrote:
> Dear Community,
>
> For the PythonFOSDEM [1] on
Tim Chase writes:
>> result = [(tmp, tmp+1) for tmp in map(expensive_calculation, data)]
>
> As charmingly expressive as map() is, the wildly different behavior in
> py3 (it's a generator that evaluates lazily) vs py2 (it consumes the
> entire iterable in one go) leads me to avoid it in general,
Peter Otten wrote, on January 09, 2017 6:51 AM
>
> Deborah Swanson wrote:
>
> > Even better, to get hold of all the records with the same
Description
> > as the current row, compare them all, mark all but the different
ones
> > for deletion, and then resume processing the records after the last
Tim Chase wrote, on January 09, 2017 6:22 AM
>
> On 2017-01-08 22:58, Deborah Swanson wrote:
> > 1) I have a section that loops through the sorted data, compares two
> > adjacent rows at a time, and marks one of them for deletion if the
> > rows are identical.
> > and my question is whether ther
breamore...@gmail.com wrote, on January 09, 2017 8:32 AM
>
> On Monday, January 9, 2017 at 2:22:19 PM UTC, Tim Chase wrote:
> > On 2017-01-08 22:58, Deborah Swanson wrote:
> > > 1) I have a section that loops through the sorted data, compares
two
> > > adjacent rows at a time, and marks one of th
On 09/01/17 21:40, Deborah Swanson wrote:
Peter Otten wrote, on January 09, 2017 6:51 AM
records = sorted(
set(records),
key=operator.attrgetter("Description")
)
Good, this is confirmation that 'sorted()' is the way to go. I want a 2
key sort, Description and Date, but I think I can f
Tim Chase wrote, on January 09, 2017 5:53 AM
>
> On 2017-01-09 05:00, Deborah Swanson wrote:
> > Code does in fact have the power to control what happens
> > in the console. How do you think Linux does it on their terminals
with
> > clickable links? Granted, the code may have to specify parameter
Steven D'Aprano writes:
> 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)
> r
Rhodri James wrote:
> On 09/01/17 21:40, Deborah Swanson wrote:
>> Peter Otten wrote, on January 09, 2017 6:51 AM
>>>
>>> records = sorted(
>>> set(records),
>>> key=operator.attrgetter("Description")
>>> )
>>
>> Good, this is confirmation that 'sorted()' is the way to go. I want a 2
>> ke
On Monday, January 9, 2017 at 5:34:12 PM UTC, Tim Chase wrote:
> On 2017-01-09 08:31, breamoreboy wrote:
> > On Monday, January 9, 2017 at 2:22:19 PM UTC, Tim Chase wrote:
> > > I usually wrap the iterable in something like
> > >
> > > def pairwise(it):
> > > prev = next(it)
> > > for th
breamore...@gmail.com wrote:
> On Monday, January 9, 2017 at 5:34:12 PM UTC, Tim Chase wrote:
>> On 2017-01-09 08:31, breamoreboy wrote:
>> > On Monday, January 9, 2017 at 2:22:19 PM UTC, Tim Chase wrote:
>> > > I usually wrap the iterable in something like
>> > >
>> > > def pairwise(it):
>> >
On Mon, Jan 9, 2017 at 5:33 PM, Deborah Swanson
wrote:
> Ok, here is the crux of this thread's communication problem. I didn't
> ask, or particularly care for all these lectures on the technology of
> terminal emulators. I asked how to code Python to make clickable links.
>
> Since all of you are
Peter Otten wrote, on January 09, 2017 3:27 PM
>
> While stable sort is nice in this case you can just say
>
> key=operator.attrgetter("Description", "Date")
>
> Personally I'd only use sorted() once and then switch to the
> sort() method.
This works perfectly, thank you.
As I read the docs,
Larry Martell wrote, on January 09, 2017 4:11 PM
>
> On Mon, Jan 9, 2017 at 5:33 PM, Deborah Swanson
> wrote:
> > Ok, here is the crux of this thread's communication problem. I
didn't
> > ask, or particularly care for all these lectures on the technology
of
> > terminal emulators. I asked how
On 01/09/2017 06:02 PM, Deborah Swanson wrote:
> Fair enough. I only suggested that they could have started their own
> thread, but mainly just to point out that they would have been off-topic
> if they did. I didn't demand that they do so, I just wanted them to
> think about it.
I don't see how i
I've just release txAWS 0.2.3.1. txAWS is a library for interacting with
Amazon Web Services (AWS) using Twisted.
AWSServiceEndpoint's ssl_hostname_verification's parameter now defaults to
True instead of False. This affects all txAWS APIs which issue requests to
AWS endpoints. For any applicat
On Mon, Jan 9, 2017 at 8:33 PM, Michael Torrie wrote:
> On 01/09/2017 06:02 PM, Deborah Swanson wrote:
>> Fair enough. I only suggested that they could have started their own
>> thread, but mainly just to point out that they would have been off-topic
>> if they did. I didn't demand that they do so
On 10/01/17 00:54, Deborah Swanson wrote:
Since I won't change the order of the records again after the sort, I'm
using
records.sort(key=operator.attrgetter("Description", "Date"))
once, which also works perfectly.
So both sorted() and sort() can be used to sort namedtuples. Good to
know!
A
On 2017-01-09 13:16, Paul Rubin wrote:
> Tim Chase writes:
> >> result = [(tmp, tmp+1) for tmp in map(expensive_calculation,
> >> data)]
> >
> > As charmingly expressive as map() is, the wildly different
> > behavior in py3 (it's a generator that evaluates lazily) vs py2
> > (it consumes the entir
Ben Bacarisse writes:
> [(lambda tmp: (tmp, tmp+1))(expensive_calculation(x)) for x in data]
Nice. The Haskell "let" expression is implemented as syntax sugar for
that, I believe.
--
https://mail.python.org/mailman/listinfo/python-list
Erik wrote, on January 09, 2017 5:47 PM
> As people keep saying, the object you have called 'records'
> is a *list*
> of namedtuple objects. It is not a namedtuple.
>
> IIRC, you create it using a list comprehension which creates the
> records. A list comprehension always creates a list.
Well
On 2017-01-09 14:33, Deborah Swanson wrote:
> Ok, here is the crux of this thread's communication problem. I
> didn't ask, or particularly care for all these lectures on the
> technology of terminal emulators. I asked how to code Python to
> make clickable links.
The crux of the problem is that wo
On 2017-01-10 03:02, Deborah Swanson wrote:
Erik wrote, on January 09, 2017 5:47 PM
As people keep saying, the object you have called 'records'
is a *list*
of namedtuple objects. It is not a namedtuple.
IIRC, you create it using a list comprehension which creates the
records. A list comprehensi
On 01/09/2017 07:02 PM, Deborah Swanson wrote:
Erik wrote, on January 09, 2017 5:47 PM
As people keep saying, the object you have called 'records'
is a *list*
of namedtuple objects. It is not a namedtuple.
IIRC, you create it using a list comprehension which creates the
records. A list compre
On 10/01/17 03:02, Deborah Swanson wrote:
Erik wrote, on January 09, 2017 5:47 PM
IIRC, you create it using a list comprehension which creates the
records. A list comprehension always creates a list.
Well no. The list is created with:
records.extend(Record._make(row) for row in rows)
No, th
MRAB wrote, on January 09, 2017 7:37 PM
>
> On 2017-01-10 03:02, Deborah Swanson wrote:
> > Erik wrote, on January 09, 2017 5:47 PM
> >> As people keep saying, the object you have called 'records' is a
> >> *list* of namedtuple objects. It is not a namedtuple.
> >>
> >> IIRC, you create it using
Is it silly to create an enumeration with only a single member? That is, a
singleton enum?
from enum import Enum
class Unique(Enum):
FOO = auto()
The reason I ask is that I have two functions that take an enum argument. The
first takes one of three enums:
class MarxBros(Enum):
GROUCH
Ethan Furman wrote, on January 09, 2017 8:01 PM
>
> On 01/09/2017 07:02 PM, Deborah Swanson wrote:
> > Erik wrote, on January 09, 2017 5:47 PM
>
> >> As people keep saying, the object you have called 'records' is a
> >> *list* of namedtuple objects. It is not a namedtuple.
> >>
> >> IIRC, you cr
On 01/09/2017 08:43 PM, Steven D'Aprano wrote:
Is it silly to create an enumeration with only a single member? That is, a
singleton enum?
from enum import Enum
class Unique(Enum):
FOO = auto()
The reason I ask is that I have two functions that take an enum argument. The
first takes one
Erik wrote, on January 09, 2017 8:06 PM
>
> On 10/01/17 03:02, Deborah Swanson wrote:
> > Erik wrote, on January 09, 2017 5:47 PM
> >> IIRC, you create it using a list comprehension which creates the
> >> records. A list comprehension always creates a list.
> >
> > Well no. The list is created wi
The docs say that enums can be iterated over, but it isn't clear to me whether
they are iterated over in definition order or value order.
If I have:
class MarxBros(Enum):
GROUCHO = 999
CHICO = 5
HARPO = 11
ZEPPO = auto()
GUMMO = -1
GROUCHO, CHICO, HARPO, ZEPPO, GUMMO = list(
Steven D'Aprano writes:
> Is it silly to create an enumeration with only a single member? That
> is, a singleton enum?
>
> from enum import Enum
>
> class Unique(Enum):
> FOO = auto()
>
>
> The reason I ask is that I have two functions that take an enum
> argument. The first takes one of three
On 01/09/2017 09:18 PM, Steven D'Aprano wrote:
The docs say that enums can be iterated over, but it isn't clear to me whether
they are iterated over in definition order or value order.
If I have:
class MarxBros(Enum):
GROUCHO = 999
CHICO = 5
HARPO = 11
ZEPPO = auto()
G
On 01/09/2017 08:51 PM, Deborah Swanson wrote:
Ethan Furman wrote, on January 09, 2017 8:01 PM
As I said earlier, I admire your persistence -- but take some
time and learn the basic vocabulary as that will make it much
easier for you to ask questions, and for us to give you
meaningful answers.
On Tuesday 10 January 2017 16:55, Ethan Furman wrote:
> On 01/09/2017 09:18 PM, Steven D'Aprano wrote:
>
>> The docs say that enums can be iterated over, but it isn't clear to me
>> whether they are iterated over in definition order or value order.
>>
>> If I have:
>>
>> class MarxBros(Enum):
>>
Ethan Furman wrote, on January 09, 2017 10:06 PM
>
> On 01/09/2017 08:51 PM, Deborah Swanson wrote:
> > Ethan Furman wrote, on January 09, 2017 8:01 PM
>
> >> As I said earlier, I admire your persistence -- but take some time
> >> and learn the basic vocabulary as that will make it much easier f
On 09.01.17 12:46, Paul Rubin wrote:
Serhiy Storchaka writes:
gen = (expensive_calculation(x) for x in data)
result = [(tmp, tmp + 1) for tmp in gen]
result = [(tmp, tmp+1) for tmp in map(expensive_calculation, data)]
Yes, of course, but only in the case of one-argument function
expensive_
77 matches
Mail list logo