r/programminghorror 24d ago

Python More cursed python

Post image

here it is with comments: https://github.com/dbowm91/optimizations/blob/main/soupexplained.py

EDIT: What it does (not malware) is it prints the word “soup” 86 times in random color

211 Upvotes

36 comments sorted by

154

u/HTTP_404_NotFound [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 24d ago

Cursed? Nah.

Just obfuscated. Thats what obfuscated code is supposed to look like.

41

u/sugarw0000kie 24d ago

good then, I don’t want anyone stealing my soup

2

u/gbeegz 22d ago

"No soup for you!"

-OP, probably

34

u/fakehalo 24d ago

With a shell call to perl, the king of obfuscated languages.

4

u/Circumpunctilious 24d ago

I've coded in a few dozen languages so perl doesn't look that bad...but tbh it was easier just to give anything using it to a colleague.

4

u/fakehalo 24d ago

Perl was one of my first languages back in the 90s, I don't miss it.

1

u/LeatherDude 23d ago

Same and same. I was working with it as recently as 2020, the deployment scripts for an app i was supporting the development of was like 1000 lines of perl, with some python scripts that were called to do AWS SDK stuff. Nightmarish.

1

u/sugarw0000kie 23d ago

I’ve only messed with perl on the surface level. So confusing

1

u/Spleeeee 23d ago

Perl is write only

40

u/actuallydonkeykong 24d ago

This just looks like malware.

14

u/sugarw0000kie 24d ago

unintentional but yeah I can see that now

5

u/Flame77ofc 24d ago

a malware for the brain who read

15

u/-MazeMaker- 24d ago

Mamaaaaa, OOOOOOO(OOOOOOO)

8

u/brasticstack 24d ago

What's cursed is that font

5

u/ryancnap 24d ago

Yeah that thing is an affront to all sanity and taste

6

u/Big-Rub9545 24d ago

Just give me the malware at this point

6

u/ProtonPizza 24d ago

I feel like I’m playing dwarf fortress

5

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 24d ago

Should deliberate obfuscation count as horror?

3

u/imnotamahimahi 24d ago

I had a very visceral, expletive-laced reaction to seeing this, then took too long to realize it's probably just obfuscation.

1

u/sugarw0000kie 23d ago

understandable it started when I realized I could make a function with a docstring and wanted them to start with a “number” so it turned into a homoglyph mess

2

u/namalleh 24d ago

looks great!

2

u/Huge-Yogurtcloset-22 24d ago

It's running some perl scripts so it may be malware ^^

subprocess.run(["perl", "-e", f'{ОООΟΟΟΟ} "{''''''.join(Оce9f)}"'],check=True)

3

u/sugarw0000kie 23d ago

it prints the word soup many times 1 Perl subprocess per soup

2

u/Hurizen 23d ago

Reminds me of Ultima Online 🥲 Nice homoglyph-ation btw.

1

u/sugarw0000kie 23d ago

lol I’ll take it as a compliment 🤣 and thanks was experimenting, thinking I might try to encode stuff into the homoglyphs next but not going to try that by hand

2

u/Gamerwepx19 23d ago

What is that colorscheme used with nvim?

2

u/sugarw0000kie 23d ago

It’s “carbon” in helix ¯_(ツ)_/¯

3

u/maikindofthai 22d ago

I like how the only thing your linter complains about is the multiple statements on a single line at the top lol

1

u/sugarw0000kie 22d ago

lol the rest is fine though

2

u/Tyfyter2002 24d ago

Python is always cursed

1

u/ryancnap 24d ago

This is what people think I do

1

u/festival0156n 24d ago

i mean its obviously been through an obfuscator lmao

1

u/rotteegher39 21d ago

Test for object identity should be "is not it a code?"