• CanadaPlus@lemmy.sdf.org
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      3 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
      ·
      3 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

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

    Hahaha now code-golf it. One line FTW!

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

  • toddestan@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    3 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”.

    • SkyeStarfall@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      0
      ·
      3 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
        ·
        3 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