E
> On 3 Sep 2023, at 22:49, Chris Green via Python-list
> wrote:
>
> Mostly I am managing to get things to work as I want but better
> documentation of gpiod would be a great help.
Ask the author? https://github.com/aswild/python-gpiod
Maybe read the source code for hints?
Barry
--
https:/
On 2023-09-03 21:43, Jonathan Gossage via Python-list wrote:
I am attempting to use forward references in my program and I am failing.
This also does not work with the older way of putting the name of a class
as a string. Here is some sample code:
from __future__ import annotations
from datacla
On Mon, 4 Sept 2023 at 07:44, Pierre Fortin via Python-list
wrote:
>
> Hi,
>
> reversed() results are fine until iterated over, after which the
> results are no longer available. This was discovered after using
> something like this:
>
> rev = reversed( sorted( list ) )
> sr = sum( 1 for _ in rev
On 9/3/2023 12:10 PM, Jan Erik Moström via Python-list wrote:
I'm looking for some advice for how to write this in a clean way
I want to replace some text using a regex-pattern, but before creating
replacement text I need to some file checking/copying etc. My code right now
look something like
On 9/1/2023 12:15 PM, Pierre Fortin via Python-list wrote:
Hi,
reversed() results are fine until iterated over, after which the
results are no longer available. This was discovered after using
something like this:
rev = reversed( sorted( list ) )
sr = sum( 1 for _ in rev )
# rev is now destroye
It is by design. `sorted` returns a list, while `reversed` returns an iterator.
Iterators are exhaust-able, and not reusable. So be mindful of this and if you
are going to "re-use” the sequence returned by iterator, convert it to list
first.
Have a look at `itertools` library, which contains a
I am using the gpiod package for manipulating GPIO inputs/outputs on a
Beaglebone Black SBC (like a Raspberry Pi but with more flexible I/O).
Mostly I am managing to get things to work as I want but better
documentation of gpiod would be a great help.
For example, when one has found an I/O pin (a
Hi,
reversed() results are fine until iterated over, after which the
results are no longer available. This was discovered after using
something like this:
rev = reversed( sorted( list ) )
sr = sum( 1 for _ in rev )
# rev is now destroyed
So reversed() results can only be iterated once unlike so
Alan Gauld wrote:
> On 31/08/2023 22:15, Chris Green via Python-list wrote:
>
> > class Gpiopin:
> >
> > def __init__(self, pin):
> > #
> > #
> > # scan through the GPIO chips to find the line/pin we want
> > #
> > for
I am attempting to use forward references in my program and I am failing.
This also does not work with the older way of putting the name of a class
as a string. Here is some sample code:
from __future__ import annotations
from dataclasses import dataclass
from typing import TypeAlias
ColorDef:
On 3 Sep 2023, at 19:13, MRAB via Python-list wrote:
> You could use pass an anonymous function (a lambda) to re.sub:
Of course !! Thanks.
= jem
--
https://mail.python.org/mailman/listinfo/python-list
On 2023-09-03 17:10, Jan Erik Moström via Python-list wrote:
I'm looking for some advice for how to write this in a clean way
I want to replace some text using a regex-pattern, but before creating
replacement text I need to some file checking/copying etc. My code right now
look something like
I'm looking for some advice for how to write this in a clean way
I want to replace some text using a regex-pattern, but before creating
replacement text I need to some file checking/copying etc. My code right now
look something like this:
def fix_stuff(m):
# Do various things that invol
13 matches
Mail list logo