• HStone32@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    Having a similar moment right now. I’m trying to figure out how to compute the transformation matrix for reflecting a bitmap of any given dimension across the y axis, but all the tutorials that come up in my search just tell me to import some python library. Its like nobody wants to learn how to do anything anymore.

    • CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      7 months ago

      Because this example isn’t really programming, it’s just calling an existing library. Which is the big joke about Python.

    • Lupec@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      My best guess is it’s a play at the usual “all you do in python is import libraries without knowing how they work lololol” dig but yeah, I don’t find it particularly funny either

  • adr1an@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    7 months ago

    This is exactly why we love Python (and other languages with rich package ecosystem, even when only on their niche usage cases). You can build upon other people’s knowledge and effort to do cool things efficiently and effectively!

  • qx128@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    7 months ago

    Hahaha now code-golf it. One line FTW!

    remove(Image.open(‘cl.jpeg’)).save(‘output.png’)

    • SkyeStarfall@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      While yes, the true issue here is that, for some reason, the code only imports the remove method from the package, instead of importing the package and doing rembg.remove().

      • trashgirlfriend@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        7 months ago

        if you only wanted to import remove you could maybe import as rembg_remove

        unless there’s some weird taboo against doing that I don’t know about, I’m an awful programmer tbh

  • toddestan@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    7 months ago

    That reminds me back when some time ago, I was tired of dealing with sketchy, and often broken, websites and programs for downloading videos from Youtube. I figured these sorts of programs must be doing something along the lines of downloading the Youtube page, parsing through the massive pile of HTML and Javascript to find the stream, and then saving that to a video file. That seemed like something I could do myself with Python, so I set out to see if I could figure out how to do it.

    A few minutes and a couple of web searches later, I discovered that someone else had figured that all out already and I just needed to do “pip install pytube”.