• 3 Posts
  • 37 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle




  • Thanks for sharing this. I took the time to read through the documentation of the re module. Here’s my review of the functions.

    Useful:

    • re.finditer returns an iterator over all Match objects
    • re.search returns the first Match object or None if there are no matches.
    • r'' use raw strings for patters so you don’t have to worry about backslashes
    • the optional flags argument modifies the behaviour (case insensitive, multiline)

    Utility:

    • re.sub replace each match in the string
    • re.split split a string by a regular expression

    The Match object:

    • match.groups(0) returns the portion of text matched by the pattern
    • match.groups(1) returns the first capturing group
    • match.groups(2) returns the second capturing group, and so on

    I don’t understand why these exist:

    • re.match like search, but only matches at the beginning of the string. why not just use ‘^’ or ‘\A’ in the pattern you pass to ‘search’?
    • re.fullmatch like ‘search’, but only if the full string matches. Why not just use ‘\A’ and ‘\Z’ in the pattern you pass to ‘search’?
    • re.findall Returns all matches. It seems like a shitty version of ‘finditer’. The function has three different return types which depend on the pattern you pattern you pass to the function. Who wants to work with that?



  • alyth@lemmy.worldtolinuxmemes@lemmy.worldLOL
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    2 months ago

    or traditional Fedora, which also has often unstable packages, dnf is often unusable

    My experience with dnf is that it’s slow as molasses but your average computer user isn’t gonna install 10 new CLI apps per day /j

    I’ve used Discover (dnf or flatpack backend) and you can install just about any software with 1 click. It takes a minute to install but that’s fine.







  • alyth@lemmy.worldtolinuxmemes@lemmy.worldCtrl + Shift + A
    link
    fedilink
    arrow-up
    14
    arrow-down
    3
    ·
    edit-2
    4 months ago

    so I can figure out how to export a PNG.

    1. File > Export As
    2. Under ‘Select File Type’ choose png, or name the file anything ending in .png
    3. Click Export. Leave the settings as-is or tweak them if you know what you’re doing
    4. Confirm

    I spent five hours trying to merge some layers

    1. Right Click the Layer
    2. In the context menu, click Merge Down

    Your examples suck. Got any real examples?