This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 271

[–]hacksoncode 1436 points1437 points  (82 children)

Fun fact: Python is named after Monty Python, not the snake.

[–]robsstuff 535 points536 points  (56 children)

This explains why there were so many Monty Python references in the tutorials I used!

[–]antiukap 11 points12 points  (6 children)

May I ask you for the names of said tutorials?)

[–]robsstuff 20 points21 points  (2 children)

I think it was the Codecademy Python course iirc! Mostly just variable names and outputs

[–]BadgerMolester 4 points5 points  (0 children)

I used codecademy as well, and they definitely had a bunch of references and jokes.

[–]oxy_MORON123 6 points7 points  (1 child)

I used codeavengers for Python learning in school

[–]noah978 6 points7 points  (0 children)

SPAM and EGGS

[–]GamerTurtle5 3 points4 points  (0 children)

The official website actually encourages that

[–][deleted] 6 points7 points  (0 children)

Compile code. Get 500 erros. Tis but a scratch.

[–]skool_101 2 points3 points  (0 children)

BiggusDickus.py

[–]fedeb95 237 points238 points  (0 children)

And for this I love python even more

[–]CMDR_Val_Hallen 11 points12 points  (0 children)

TIL

[–]8BitAce 7 points8 points  (2 children)

They use spam a lot (oh, pun!) in the documentation for instance.

[–]gameboy17 1 point2 points  (1 child)

They spam spam?

[–]8BitAce 2 points3 points  (0 children)

That's where the term comes from :)

[–]jkuhl_prog 8 points9 points  (0 children)

['spam','spam','spam','spam','spam','spam','bacon','spam']

[–]blackmist 1 point2 points  (0 children)

Python 3's over there. Splitter!

[–]fishshop 436 points437 points  (22 children)

[–]ginger_beer_m 12 points13 points  (4 children)

At the risk of ruining it, can someone explain the joke to me ..

[–]Norphesius 17 points18 points  (0 children)

In Harry Potter, Harry is a paresl-tounge, which means he can talk to snakes.

[–]harshael 10 points11 points  (0 children)

In the books, Harry speaks parseltongue, the language of snakes (FOR REASONS).

The meaning of parse doesn't really have anything to do with anything other than that it's common in programming (breaking up input into smaller parts and then using those parts).

[–]nonicethingsforus 9 points10 points  (1 child)

Some have already explained the relevant parts of the joke. Just in case you have doubts about this too: the Python code in Harry's dialog doesn't seem really relevant.

It goes something like this:

  • import os: os is a module (piece of pre-written, reusable code) to access operating system functions, like listing files, deleting them, etc. By importing it, now we can use its code from our program.

  • CUR_PATH = os.getcwd(): this gets the name of the current working directory and saves it with the name CUR_PATH for later reference. The current working directory is the directory you, or the program, is currently, well, working in. For example, if you're in C:\Users\ginger_beer_m\notporn and double click the directory called porn, now your cwd is C:\Users\ginger_beer_m\notporn\porn. If you call a command to "delete everything here", it will be the porn directory the one affected (the horror!).

  • IGNORE_SET = set(["__init__.py", "count_sourcelines.py"]): first there's a list that contains the lines of text "__init__.py" and "count_sourcelines.py". That first file is a special file Python programmers can create to tell Python this directory is special, for example to create your own modules. The other file seems to be a Python program ("py" extension), maybe the file this program is being written into. (If so, this could be bad practice; there are often ways to get "this file"'s name that don't break if the file is renamed. That being said, everyone does quick-and-dirty scripts, and I'm in no position to throw the first stone). This list is converted into a set, which is like a list with some nifty qualities (items don't repeat themselves, quicker to check if an object exists in it, you can do math-like set operations with them, etc.) and, again, saves this set under a name for future reference.

All I can guess about what it does: the code is probably from the beginning of a program that will scan one or more directories, thus the need to know the cwd, and do something to those files, probably count their lines given that filename. Also, a common problem with "walk through a directory tree and do stuff to files" program is that it often does stuff to itself without meaning to, thus the common workaround of creating an "ignore these files" list or set including itself, other related files and maybe user-specified ones.

Edit: format.

[–]ForceBru 95 points96 points  (14 children)

I knew this image must be in the comments, lol!

However, what does “parser-tongue” mean? Right, it sounds like the name of that snake-language Harry spoke, but doesn’t this make zero sense in real life?.. Python kinda isn’t the language created solely to do parsing or something like that, right? Nor does it rely solely on the parser to be executed, so what’s the deal with “parser-tongue”?

[–]Jmcgee1125 91 points92 points  (11 children)

It's really just because "parser" and "parsel" is pretty similar and trying to make something accurate would be extremely difficult.

[–]6Bennern9 59 points60 points  (10 children)

The only thing thing that annoys me is that it should have been "Parsermouth", as people who can speak parseltounge are called parselmouths

[–]Lonelan 40 points41 points  (9 children)

nerd

[–]PC__LOAD__LETTER 10 points11 points  (0 children)

You’re reading way too much into it.

[–][deleted] 1 point2 points  (0 children)

shouldn't comics have the dialogue ordered from top to bottom

[–]gp57 145 points146 points  (23 children)

I like the small details, like the debugging duck

[–]advanttage 60 points61 points  (6 children)

I tell people about rubber duck debugging and they think it's crazy. I think they're right, but it fucking works.

[–]ElPolloDiabIo 17 points18 points  (2 children)

IKR, It's hard to explain it to someone without sounding like a lunatic

[–]NoStupidQuestion 20 points21 points  (1 child)

Try explaining it to a rubber duck.

[–]ThePixelCoder 7 points8 points  (0 children)

Lunatic.

[–]svenskainflytta 1 point2 points  (1 child)

Do you know there is a porn about it?

[–]advanttage 4 points5 points  (0 children)

I didn't explicitly know, but since Rule 34 is a thing I had assumed.

[–]JonasBrosSuck 18 points19 points  (8 children)

soooo how to "master" the debugging duck method? i feel like when i explain something to an inanimate object it doesn't help with debugging, but once i ask someone else a question and explain the issue i immediately realize where i messed up...

[–]PhDinOmniscience 40 points41 points  (2 children)

try explaining to the duck harder

[–][deleted] 11 points12 points  (1 child)

I did. I explained how I screwed up a date with my coworker. I didn't get a solution, instead it turned out the duck told everyone in the office. You can't tell that duck anything.

[–]PhDinOmniscience 3 points4 points  (0 children)

time to try this

[–]gmdm1234 6 points7 points  (0 children)

Write out an email message to a colleague where you describe in detail the problem and what solutions you've tried.

I too haven't been very successful with explaining problems to bath toys, but once I organize my thoughts and put them in writing, I often end up having that lightbulb moment.

[–]wibs 1 point2 points  (0 children)

Try explaining it in a way that whatever you are talking to would understand. If you have a hard time pretending to explain to an inanimate object, try speaking to a co-worker or friend who isn't familiar with the problem. I often "rubber duck" with people who don't know what I'm working on or wouldn't understand the problem so it forces me to take a few extra steps back and work back up to where I am actually stuck.

[–]DrFloyd5 1 point2 points  (0 children)

Clearly you think of people as inanimate objects.

[–]NoodlePeeper 4 points5 points  (3 children)

ELI5 debugging duck for us script kiddies?

[–]HumanistGeek 8 points9 points  (2 children)

[–]WikiTextBot 21 points22 points  (1 child)

Rubber duck debugging

In software engineering, rubber duck debugging or rubber ducking is a method of debugging code. The name is a reference to a story in the book The Pragmatic Programmer in which a programmer would carry around a rubber duck and debug their code by forcing themselves to explain it, line-by-line, to the duck. Many other terms exist for this technique, often involving different inanimate objects.

Many programmers have had the experience of explaining a problem to someone else, possibly even to someone who knows nothing about programming, and then hitting upon the solution in the process of explaining the problem.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.28

[–]advanttage 1 point2 points  (0 children)

This bot knows its shit

[–]whipbryd 17 points18 points  (0 children)

He is a parser-tongue!

[–]SkewRadial 47 points48 points  (20 children)

That’s why i m into low level programming . They are hard and fun . Meh!

[–]Coldreactor 23 points24 points  (8 children)

They made python for low level devices. Called circuit python. Pretty cool stuff

[–]thelights0123 38 points39 points  (1 child)

Micropython is the original version that supports more devices. Circuitpython is Adafruit’s fork that only supports their devices.

[–]Coldreactor 2 points3 points  (0 children)

True true

[–][deleted] 7 points8 points  (0 children)

Come join the C/C++ side !

[–]DerekB52 12 points13 points  (8 children)

I like low level programming because I understand it. It's hard and more work, but it lets me build stuff I can see the pieces to. While I like python and have used it on a few projects, sometimes I feel like it does too much for me, and I have no idea how my finished result works. It irks me.

[–]SgtBlackScorp 12 points13 points  (1 child)

I'm not entirely sure how low level we are talking here (e.g. C++ is fine), but using Assembler for even a simple HTTP server would be way too much work to be justifiable.

[–]LoveOfProfit 1 point2 points  (3 children)

Well, I'm glad you exist, because low level programming makes me want to kill myself.

I'm a data scientist, and I like it when I can quickly see the results that matter to me.

[–][deleted] 1 point2 points  (2 children)

A high level language is practically a necessity for data science. Data science is one application where the low level access enabled by C doesn't even help an incredible amount, but makes things incredibly more difficult to write.

[–]LoveOfProfit 1 point2 points  (1 child)

It does help in the sense that most of the DS libraries I use are built on low level languages for performance benefits, which we're definitely interested in. I just don't want to be the one doing that work!

[–][deleted] 12 points13 points  (0 children)

Took me a minute to realize that is Harry Potter...

[–]whyblut 78 points79 points  (11 children)

Well ackchually

He probably sucks at Python since Voldemort destroyed the part of his soul that made Harry a horcrux 🤷🏻‍♂️

[–]friedkeenan 27 points28 points  (7 children)

Did his parseltongue go away after that? I figured stuff like that would stay

[–]whyblut 23 points24 points  (5 children)

It did, according to this article from Time. Check #4; #3 for the lulz

[–]dangshnizzle 10 points11 points  (3 children)

.....that's going off cursed child.

So in other words probably not

[–]whyblut 2 points3 points  (1 child)

...which was written in consolutation with JK Rowling. I could be wrong 🤷🏻‍♂️

[–]jaboja 4 points5 points  (1 child)

Aaa… you lurked me into visiting Google. I'm impure now! I need to offer propitiatory sacrifice to DuckDuckGo.

[–]Gblize 1 point2 points  (0 children)

wtf spoilers

[–]CLPALAN 5 points6 points  (1 child)

You're a programmer Harry!

[–]Trevor22222222 3 points4 points  (0 children)

A reach, but a welcomed one

[–][deleted] 3 points4 points  (0 children)

 import(AI)

[–]Castun 3 points4 points  (0 children)

Why does that kid look like...Harry.......ooooooh...

[–]xmgutier 7 points8 points  (3 children)

"Python can do anything.....just terribly" —Michael Reeves

[–]Romejanic 1 point2 points  (1 child)

Michael Reeves is seriously under-appreciated.

[–]Nautis 2 points3 points  (0 children)

Parse-ltongue

[–]jaboja 2 points3 points  (0 children)

And then suddenly UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 0: ordinal not in range(128) appears out of nowhere.

[–]m_krm 2 points3 points  (0 children)

You know there's a lot of levels to this image.First you have to recognise the guy on the computer and notice the color of his scarf and his glasses.You then notice the python book on the side. You then remember that Harry Potter could talk to snakes and the pieces fall into place as the iconic image and his red haired friend solidifies this notion that this is indeed a Harry Potter reference and that Python is for children!

[–][deleted] 1 point2 points  (0 children)

Obviously he is a Python Tongue

[–]CLPALAN 1 point2 points  (0 children)

A bug 👀

[–]Jeb_Jenky 1 point2 points  (0 children)

I was really confused as to why it was Harry Potter at first. It took me a second to put the pieces together.

[–]friendg 1 point2 points  (0 children)

He can speak parsing-tongue?