Thread 105741131 - /g/ [Archived: 674 hours ago]

Anonymous
6/29/2025, 8:50:48 AM No.105741131
navysealpasta
navysealpasta
md5: 20c54739e4e7dcd6990224e9d979ede6🔍
i wrote a script that generates picrel. type whatever you want into the terminal and it makes a python file like picrel and runs it. it's like print but needlessly complicated. i mostly did it because i want to write poetry with python
Replies: >>105741137 >>105741138 >>105741373 >>105741414 >>105742192 >>105742235 >>105742255 >>105742584 >>105742932 >>105743018 >>105743650 >>105744030
Anonymous
6/29/2025, 8:52:29 AM No.105741137
>>105741131 (OP)
Time & money well spent, anon. Are you going to share the source code or keep it for yourself so you get rich?
Replies: >>105741148 >>105742200
Anonymous
6/29/2025, 8:52:31 AM No.105741138
>>105741131 (OP)
vim macro as a programming language
Anonymous
6/29/2025, 8:54:11 AM No.105741148
>>105741137
i'm feeling generous, and i'm a man of the people, so here is the code. remember me when i'm on the cover of forbes

https://github.com/the-rainmaker86/python-poetry
Replies: >>105741192 >>105741373 >>105742584
Anonymous
6/29/2025, 9:03:57 AM No.105741192
>>105741148
kys redditor
Replies: >>105741197
Anonymous
6/29/2025, 9:04:50 AM No.105741197
snoo
snoo
md5: 897bccdb7dea0c7176880d11bad3286f🔍
>>105741192
what makes u think i'm a redditor
Replies: >>105746474
Anonymous
6/29/2025, 9:32:57 AM No.105741373
>>105741131 (OP)
>>105741148
Here's my poem/haiku. Can you generate something for me? Here's my input:
there were 10 dicks that
op sucked to completion
he was really gay
Replies: >>105741719
Anonymous
6/29/2025, 9:39:57 AM No.105741414
>>105741131 (OP)
https://www.perlmonks.org/?node_id=1111395
Anonymous
6/29/2025, 10:30:02 AM No.105741719
Screen Shot 2025-06-29 at 4.30.48 AM
Screen Shot 2025-06-29 at 4.30.48 AM
md5: f8ef49bad0269d820a367c27d7fea3a9🔍
>>105741373
Replies: >>105741994 >>105742207 >>105743650
Anonymous
6/29/2025, 11:17:15 AM No.105741994
>>105741719
I asked my friend Google Gemini, the genius, to add support for punctuation.
import keyword
import sys
import re

reserved_words = keyword.kwlist

def sanitize_for_function_name(word):
word = word.replace('.', '_fullstop')
word = word.replace(';', '_semicolon')
word = word.replace(':', '_colon')
word = word.replace('?', '_questionmark')
word = word.replace('!', '_exclamation')
word = word.replace(',', '_comma')
word = word.replace('-', '_dash')
word = re.sub(r'[^a-zA-Z0-9_]', '', word)

return word.lower()

inp_words = sys.argv[1:]
functions_and_words = []

for word in inp_words:
sanitized_word = sanitize_for_function_name(word)
if sanitized_word in reserved_words:
sanitized_word += '_func'

functions_and_words.append((sanitized_word, word))

paren_count = 0

with open('newpoem.py', 'w') as f:
for sanitized_word, original_word in functions_and_words:
paren_count += 1
f.write(f"def {sanitized_word}(x): return '{original_word}' + ' ' + x\n")

for i, (sanitized_word, _) in enumerate(functions_and_words):
if i == 0:
f.write(f'print({sanitized_word}(')
elif i < len(functions_and_words) - 1:
f.write(f"{sanitized_word}(")
else:
f.write(f"{sanitized_word}(''){')'* paren_count}")

print(f"Created newpoem.py with {len(functions_and_words)} functions based on input words.")
print("You can now import this file and use the functions defined in it.")
print("Example usage: from newpoem import word1, word2")
print("Then call the functions like: print(word1('your text here'))")

from newpoem import *
Just
python3 dynamic_poem.py whoop ! zoop ? doop - poop .
Replies: >>105742046
Anonymous
6/29/2025, 11:24:44 AM No.105742046
>>105741994
i would just get rid of the punctuation, shit like _exclamation ruins the flow
Replies: >>105742113
Anonymous
6/29/2025, 11:38:08 AM No.105742113
okay
okay
md5: b9405dc8b72257773f77cbfce9290b07🔍
>>105742046
>the flow
okay, M&M
Replies: >>105742165
Anonymous
6/29/2025, 11:47:59 AM No.105742165
>>105742113
>M&M

jesus
Replies: >>105742494 >>105742536
Anonymous
6/29/2025, 11:51:34 AM No.105742192
>>105741131 (OP)
>anon discovers metaprogramming
don't tell the go fags they'll SEETHE
Anonymous
6/29/2025, 11:52:43 AM No.105742200
>>105741137
geg
Anonymous
6/29/2025, 11:53:01 AM No.105742207
>>105741719
>is_
garbage
Replies: >>105742210
Anonymous
6/29/2025, 11:53:51 AM No.105742210
>>105742207
ok FINE i'll add a str.replace
Replies: >>105742224
Anonymous
6/29/2025, 11:56:23 AM No.105742224
>>105742210
wait nm that won't work
Anonymous
6/29/2025, 11:58:19 AM No.105742235
>>105741131 (OP)
this seems like something that would be trivial in LISP desu
Anonymous
6/29/2025, 12:01:02 PM No.105742255
>>105741131 (OP)
This code isn't maintainable. Please make an enterprise ready version in either C# or Java.
Replies: >>105742303 >>105742567
Anonymous
6/29/2025, 12:10:15 PM No.105742303
>>105742255
Kek'd and check'd
Anonymous
6/29/2025, 12:47:44 PM No.105742494
>>105742165
M&M was Eminem's first rap name
Anonymous
6/29/2025, 12:54:26 PM No.105742536
>>105742165
You're actually retarded.
Anonymous
6/29/2025, 1:00:02 PM No.105742567
poop_snipd
poop_snipd
md5: 4bbb677ed6187fd04a66474464c254de🔍
>>105742255
Anonymous
6/29/2025, 1:03:31 PM No.105742584
>>105741131 (OP)
>>105741148
Upvoted!

Edit: Thanks for the gold, kind stranger!
Anonymous
6/29/2025, 2:06:31 PM No.105742932
>>105741131 (OP)
#!/usr/bin/env perl

for my $fn (qw(op is gay retard)) {
*$fn = sub { print $fn . ' ' };
}
use subs qw(op is gay);

op; is; gay; &retard;
Anonymous
6/29/2025, 2:22:41 PM No.105743018
>>105741131 (OP)
Here's a much more efficient oneliner:
>print('OP is a gay retard')

What a waste of time, could've at least added some logic so it would be actually impressive... but normies will be impressed regardless
Replies: >>105743032
Anonymous
6/29/2025, 2:25:16 PM No.105743032
>>105743018
It is free open source software, anon. Add it yourself.
Anonymous
6/29/2025, 4:07:30 PM No.105743650
>>105741131 (OP)
>>105741719
based op
Anonymous
6/29/2025, 4:48:07 PM No.105744030
>>105741131 (OP)
you the same fag, OP? >>105740574
Anonymous
6/29/2025, 9:07:08 PM No.105746474
>>105741197
reddit spacing