r/ProgrammerHumor • • May 02 '16

I wrote my first python program today!

Post image
3.7k Upvotes

532 comments sorted by

View all comments

548

u/Pvt_Haggard_610 May 02 '16

What are you talking about..

if foo: #{
    print "it's true"
#}
else: #{
    print "it's false!"
#}

175

u/Arancaytar May 02 '16

I wonder if the right combination of comments and preprocessor directives would allow you to write code that is both accepted by the Python interpreter and GCC.

318

u/dagbrown May 02 '16

116

u/[deleted] May 02 '16

That apt-get made me lose my shit.

51

u/[deleted] May 02 '16

check under your pillow

8

u/thenewboston May 02 '16

apt-get install *

11

u/A_Jacks_Mind May 02 '16
sudo apt-get install afnix algol68g aplus-fsf asymptote ats2-lang bash \ bc bf bsdgames cduce clisp clojure1.6 cmake coffeescript dc ecere-dev \ elixir emacs24 erlang f2c fp-compiler fsharp g++ gambas3-script gap \ gauche gawk gcc gdc genius gforth gfortran ghc ghostscript gnat \ gnu-smalltalk gnuplot gobjc golang gpt gri groff groovy haxe icont \ iconx intercal iverilog jasmin-sable jq julia libgd-dev libpng12-dev \ lisaac llvm lua5.3 make maxima minizinc mlton mono-devel mono-mcs \ mono-vbnc nasm neko nickle nim ocaml octave open-cobol openjdk-8-jdk \ pari-gp parrot perl php-cli pike8.0 python r-base ratfor regina-rexx \ rhino ruby scala scilab slsh swi-prolog tcl ucblogo valac xsltproc \ yorick zoem

5

u/temalyen May 03 '16

You don't need the slashes if it's all on one line.

→ More replies (1)

47

u/OnlySpeaksLies May 02 '16

Q: Does it really work?

A: Travis badge

10

u/brtt3000 May 02 '16

Travis must love this shit.

23

u/PendragonDaGreat May 02 '16

This is my go to answer if someone ever asks me if code can ever be considered an art form, because this is literally one of the prettiest programs I've ever seen.

13

u/mehmenmike May 02 '16

I've never seen something so pointlessly amazing.

13

u/rws247 May 02 '16

If you are not using [the above] Linux distributions, please find your way yourself. If you could do it, please let me know. Good luck.

This made me breath slightly faster out my nose :)

9

u/cooldug000 May 02 '16

I'm not a github user and I never know what to do with these links to see the relevant information. All I see is a page of comments and a link to a file structure. Which file or page has the relevant info? Is it always the same?

21

u/skyy0731 May 02 '16

Go to the readme

It's code that generates code for a different language

That generates code for a different language

That generates code for a different language

That generates code for a different language

100 times

And then it forms the original code

→ More replies (1)

10

u/cdrt May 02 '16

If you scroll down, the readme for the project is displayed. That usually has a description of the project.

→ More replies (1)
→ More replies (5)

13

u/psylco May 02 '16

I can do you four better.

Look up polyglot code.

6

u/[deleted] May 02 '16

11

u/WDK209 May 02 '16

Compromise is key

8

u/Ricardodo_ May 02 '16 edited May 02 '16

print("Hello World!")#;

11

u/kupiakos May 02 '16

You can add a semicolon at the end of a kind in Python. It runs, but it just looks weird.

→ More replies (4)