top 50 comments

sorted by: hot top controversial new old
[–] 89 points 2 years ago (28 children)

How is this funny? 8 Upvotes at current writing???

  • source
  • hideshow 28 child comments
  • [–] 164 points 2 years ago (21 children)

    It's kind of funny because it looks like it is nonsense dreamt up by a non-programmer. But it actually works.

  • source
  • parent
  • hideshow 21 child comments
  • [–] 147 points 2 years ago (9 children)

    I thought it was poking fun at the tutorial saying instead of learning to code, import a library from someone who knows how to code.

  • source
  • parent
  • hideshow 9 child comments
  • [–] 41 points 2 years ago (5 children)

    That's what libraries are for. I'm no security expert and the sensible thing to do is using a library instead of taking a class.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 25 points 2 years ago* (4 children)

    I’m no security expert and the sensible thing to do is using a library instead of taking a class.

    Counterpoint: "not knowing your libraries" + "blind trust in the maintainer" will give you stuff like this: https://bitbucket.org/snakeyaml/snakeyaml/issues/561/cve-2022-1471-vulnerability-in

    (the thread itself is worth a read. But also very impressive is the list of big players who fell for exactly this mentality)

  • source
  • parent
  • hideshow 4 child comments
  • [–] 3 points 2 years ago

    Impressive and unsurprising. As soon as you start getting complex libraries with multiple dependencies it becomes nearly impossible to review everything. At one time I had an interest in contributing to some AI libraries, but they're a mess as soon as you go looking for points of improvement.

  • source
  • parent
  • [–] 7 points 2 years ago

    Which is funny because when I first started my CS degree in the late 80s (get off my lawn) we used to make fun of the beginning Java classes because it seems 90% of coding was to import the right library.

  • source
  • parent
  • [–] 92 points 2 years ago (8 children)
  • [–] 26 points 2 years ago (3 children)

    It's literally this comic, five years and a research team later.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 30 points 2 years ago
    from Lemmy import Upvote
    from Fediverse import Posts
    from ActivityPub import Submit
    
    target_post = 'https://lemmy.ca/post/18691085'
    num_votes = 8
    
    post = Posts.open(target_post)
    
    package = Upvote(post, num_votes)
    
    package.Submit(target_post)
    

    or something

  • source
  • parent
  • load more comments (1 reply)
  • [–] 5 points 2 years 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

  • source
  • parent
  • [–] 59 points 2 years 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!

  • source
  • [–] 58 points 2 years ago (8 children)

    Hahaha now code-golf it. One line FTW!

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

  • source
  • hideshow 8 child comments
  • [–] 59 points 2 years ago (3 children)

    If I find this in production I'm whipping your ballsack till you change it back.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 33 points 2 years ago* (3 children)

    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".

  • source
  • hideshow 3 child comments
  • [–] 30 points 2 years ago

    There's a python library for everything

  • source
  • [–] 28 points 2 years ago (1 child)
  • [–] 25 points 2 years ago (2 children)

    Remove seems like a terrible name for that method.

  • source
  • hideshow 2 child comments
  • [–] 16 points 2 years ago (1 child)

    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().

  • source
  • parent
  • hideshow 1 child comment
  • [–] 17 points 2 years ago

    Waiting for the “in one line” tutorial

  • source
  • [–] 13 points 2 years ago

    No work in micropython on uno? pls help. Need thesis in Rust do tomorgh. Removed French bloat rm -fr catz tut. Why

  • source
  • [–] 7 points 2 years ago (1 child)
  • [–] 5 points 2 years ago (1 child)

    I know this is a joke, but I totally wanna run the code and see what happens or what errors I get just for fun.

  • source
  • hideshow 1 child comment
  • load more comments
    view more: next ›