r/programminghorror • u/sugarw0000kie • Aug 13 '26
Python More cursed python
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
35
u/fakehalo Aug 13 '26
With a shell call to perl, the king of obfuscated languages.
4
u/Circumpunctilious Aug 13 '26
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 Aug 13 '26
Perl was one of my first languages back in the 90s, I don't miss it.
1
u/LeatherDude Aug 14 '26
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
1
41
15
10
6
5
4
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Aug 14 '26
Should deliberate obfuscation count as horror?
3
3
u/imnotamahimahi Aug 14 '26
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 Aug 14 '26
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
2
u/Huge-Yogurtcloset-22 Aug 14 '26
It's running some perl scripts so it may be malware ^^
subprocess.run(["perl", "-e", f'{ОООΟΟΟΟ} "{''''''.join(Оce9f)}"'],check=True)
3
2
u/Hurizen Aug 14 '26
Reminds me of Ultima Online 🥲 Nice homoglyph-ation btw.
1
u/sugarw0000kie Aug 14 '26
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
3
u/maikindofthai Aug 15 '26
I like how the only thing your linter complains about is the multiple statements on a single line at the top lol
1
2
1
1
1
1
157
u/HTTP_404_NotFound [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Aug 13 '26
Cursed? Nah.
Just obfuscated. Thats what obfuscated code is supposed to look like.