python-minifier icon indicating copy to clipboard operation
python-minifier copied to clipboard

Better compressed print statements

Open textdev-0 opened this issue 3 months ago • 0 comments

It's possible to compress print statements more then they are now, by replacing end= and newlines by putting them on the same line.

E.G. Input: print("Option A") print("Option B") print("Option C") print("Option D", end="--") print("Option E", end-"")

Output: A=print A('Option A') A('Option B') A('Option C') A('Option D',end='--') A('Option E',end-'')

A more optimal way: print('Option A\nOption B\nOption C\nOption D--Option E', end='')

Great work though, cut my code size like in half

textdev-0 avatar Nov 22 '25 20:11 textdev-0