#esoteric-python

1 messages · Page 100 of 1

astral rover
#

You can't from just bytes I'm pretty sure

floral meteor
#

awww

astral rover
#

I might be wrong

#

But I didn't think byte code held all the info for that

floral meteor
#

;-;
; ;

astral rover
#

You need a lot of extra stuff to create a code object to be executed

floral meteor
#

because the source looks like this mess:py C=lambda f:(lambda *args:(lambda o:(lambda g:{None}|{None for _ in iter(lambda:(lambda G:(not G)or o.append(G.pop()))(list((lambda:(yield from(g(*o.pop())for _ in(None,))))())),None)}and o.pop())(f(lambda *a:o.append(a)or next(iter(())))))([args]))

#

And I don't even know what it does

#

I've only been able to use it to raise StopIteration

#

!e ```py
[0][1]

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | IndexError: list index out of range
floral meteor
#

that raises IndexError

twilit grotto
#

why wouldn't it

floral meteor
#

i.e. to make an os.system command raise error, I'd write it as:

try:[0][exit_code:=os.system(command)]
except IndexError:print(f"Command errored out with exit code {exit_code}")

instead of

try: assert not (exit_code:=os.system(command))
except AssertionError:print("Command no worky")
snow beacon
#

It might be broken in this version of Python.

floral meteor
#

ah

floral meteor
#

Before 3.9:

is_error=[1,0][[1,0][os.system('command')and 1]and(print("worky")or 1)or(print("No worky")or 0)]

after 3.9:

[1,0][is_error:=os.system('command')and 1]and print("worky")or print("no worky")
#

!e ```py
print([1,0][(is_error:=import('o'+'s').system('ls')and 1)]and"worky"or "no worky","\nexit code:",is_error)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | no worky 
002 | exit code: 1
floral meteor
#

!e ```py
{print([1,0][(is_error:=import('os').system(this)and 1)]and"worky"or "no worky","\nexit code:",is_error)for this in ['ls','dir','cd']}

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | no worky 
002 | exit code: 1
003 | no worky 
004 | exit code: 1
005 | no worky 
006 | exit code: 1
earnest wing
#

You have to create an instance of CodeType, which is definitely a bit overwhelming if you don't know it lol

#

the bytes are just one argument to the constructor

floral meteor
#

ah

earnest wing
#

Easiest way is to use an existing object and just override some of its attrs

floral meteor
#

also, more on that set iterator to substitute a while loop, how does it exactly work?

#

like the

{print("<message>")for _ in iter(...,False)}
earnest wing
#

iter() with 2 args creates an iterator that, on each step, calls the 1st arg, checks if it equals the 2nd arg and halts if that's true

floral meteor
#

ah

#

so...

earnest wing
#

the set just gets rid of the duplicate values

floral meteor
#

how do I get it to return values?

#

because I can't do a walrus inside comprehension

#

Something like this?

while not _p:_p=(lambda _pp:_pp[[]!=[]]if _pp[[]!=[]]==_pp[[]==[]]else['',print("PASSWORDS DO NOT MATCH")][[]!=[]])([_getpass('new password>'),_getpass('confirm password>')])

->

_p=[(_p:=[]),{print("PASSWORDS DO NOT MATCH, YOU FOOL") for _ in iter((lambda:[_p.append(_getpass('new password>'),_p.append(_getpass('confirm password>'),_p[0]==_p[1]][2]),False)},_p[0]][2]

or...

#
_p=[(_p:=[]),{print("PASSWORDS DO NOT MATCH, YOU FOOL") for _ in iter((lambda:[_p.append(_getpass('confirm password>')),_p[0]][1]),_getpass('new password>'))},_p[0]][2]
#

whoops its wrong way aroun

#

now if it's wrong once there's no way out

#

!e ```py
_p=[(_p:=[]),{(print("PASSWORDS DO NOT MATCH, YOU FOOL"),_p.pop(()==()),_p.pop(()!=()))for _ in iter((lambda:[_p.append('password1'),_p.append('password1'),_p[~([]!=[])]==_p[~([]==[])]][2]),True)},_p[~([]!=[])]][2]
print(_p)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

password1
floral meteor
#

!e ```py
_p=[(_p:=[]),{(print("PASSWORDS DO NOT MATCH, YOU FOOL"),_p.pop(()==()),_p.pop(()!=()))for _ in iter((lambda:[_p.append('password1'),_p.append('not the password'),_p[~([]!=[])]==_p[~([]==[])]][2]),True)},_p[~([]!=[])]][2]
print(_p)

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | PASSWORDS DO NOT MATCH, YOU FOOL
002 | PASSWORDS DO NOT MATCH, YOU FOOL
003 | PASSWORDS DO NOT MATCH, YOU FOOL
004 | PASSWORDS DO NOT MATCH, YOU FOOL
005 | PASSWORDS DO NOT MATCH, YOU FOOL
006 | PASSWORDS DO NOT MATCH, YOU FOOL
007 | PASSWORDS DO NOT MATCH, YOU FOOL
008 | PASSWORDS DO NOT MATCH, YOU FOOL
009 | PASSWORDS DO NOT MATCH, YOU FOOL
010 | PASSWORDS DO NOT MATCH, YOU FOOL
011 | PASSWORDS DO NOT MATCH, YOU FOOL
... (truncated - too many lines)

Full output: too long to upload

floral meteor
#

I guess that works

#
[(_p:=[]),{(print("PASSWORDS DO NOT MATCH, YOU FOOL"),_p.pop(()==()),_p.pop(()!=()))for _ in iter((lambda:[_p.append(_getpass('new password>')),_p.append(_getpass('confirm password>')),_p[~([]!=[])]==_p[~([]==[])]][2]),True)},_p[~([]!=[])]][2]
sudden willow
#

your terminal colour hurts

floral meteor
#

The music I'm listening to hurts

#

this line of code hurts:

# IMPORT STUFF AND ENCRYPT TOKEN
import os,sys;os.system("");_get_encrypted_token=lambda:(_t:=(_getpass:=__import__('getpass').getpass)("copy and paste token here (ENTER to skip)>"))and((lambda source,key:(not key)and source or[len(source)<len(key)and(key:=key[:len(source)])or len(source)>len(key)and(key:=(key*(len(source)//len(key)+(()==())))[:len(source)]),(_s:=[ord(c)for(c)in list(source)]),(_k:=[ord(c)for(c)in list(key)]),(_p:=[]),[_p.append((((e-32)+(_k[i]-32))%95)+32)for i,e in enumerate(_s)],''.join([chr(n)for(n)in(_p)])][-1])(_t,[(_p:=[]),{(print("\x1b[31mPASSWORDS DO NOT MATCH, YOU FOOL\x1b[0m"),_p.pop(()==()),_p.pop(()!=()))for _ in iter((lambda:[_p.append(_getpass('new password>')),_p.append(_getpass('confirm password>')),_p[~([]!=[])]==_p[~([]==[])]][2]),True)},_p[~([]!=[])]][2]))or''
#

!e ```py
import os,sys;os.system("");from getpass import getpass as _getpass;_get_encrypted_token=lambda:(_t:="AAAAAAAAAAAAAAAAAAAAAAAAAA")and((lambda source,key:(not key)and source or[len(source)<len(key)and(key:=key[:len(source)])or len(source)>len(key)and(key:=(key*(len(source)//len(key)+(()==())))[:len(source)]),(_s:=[ord(c)for(c)in list(source)]),(_k:=[ord(c)for(c)in list(key)]),(_p:=[]),[_p.append((((e-32)+(_k[i]-32))%95)+32)for i,e in enumerate(_s)],''.join([chr(n)for(n)in(_p)])][-1])(_t,[(_p:=[]),{(print("\x1b[31mPASSWORDS DO NOT MATCH, YOU FOOL\x1b[0m"),_p.pop(()==()),_p.pop(()!=()))for _ in iter((lambda:[_p.append("password1"),_p.append("password1"),_p[~([]!=[])]==_p[~([]==[])]][2]),True)},_p[~([]!=[])]][2]))or''
print(_get_encrypted_token())

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

2#55914&R2#55914&R2#55914&
floral meteor
#

that works i can't believe it

#

I have cursed it further:

sys=[__import__('sys'),(os:=__import__('os')).system(""),(_get_encrypted_token:=lambda:(_t:=(_getpass:=__import__('getpass').getpass)("copy and paste token here (ENTER to skip)>"))and((lambda source,key:(not key)and source or[len(source)<len(key)and(key:=key[:len(source)])or len(source)>len(key)and(key:=(key*(len(source)//len(key)+(()==())))[:len(source)]),(_s:=[ord(c)for(c)in list(source)]),(_k:=[ord(c)for(c)in list(key)]),(_p:=[]),[_p.append((((e-32)+(_k[i]-32))%95)+32)for i,e in enumerate(_s)],''.join([chr(n)for(n)in(_p)])][-1])(_t,[(_p:=[]),{(print("PASSWORDS DO NOT MATCH, YOU FOOL"),_p.pop(()==()),_p.pop(()!=()))for _ in iter((lambda:[_p.append(_getpass('new password>')),_p.append(_getpass('confirm password>')),_p[~([]!=[])]==_p[~([]==[])]][2]),True)},_p[~([]!=[])]][2]))or'')][[]!=[]]
snow beacon
floral meteor
#

@snow beacon

#

alright, i get this output:

720
13
13
Traceback (most recent call last):
  File "<stdin>", line 147, in <module>
  File "<stdin>", line 59, in <lambda>
  File "<stdin>", line 61, in <lambda>
  File "<stdin>", line 59, in <lambda>
  File "<stdin>", line 61, in <lambda>
  File "<stdin>", line 59, in <lambda>
  File "<stdin>", line 61, in <lambda>
  File "<stdin>", line 59, in <lambda>
  File "<stdin>", line 61, in <lambda>
  File "<stdin>", line 59, in <lambda>
  File "<stdin>", line 61, in <lambda>
  File "<stdin>", line 59, in <lambda>
  File "<stdin>", line 61, in <lambda>
  File "<stdin>", line 59, in <lambda>
  File "<stdin>", line 65, in <lambda>
  File "<stdin>", line 59, in <lambda>
  File "<stdin>", line 65, in <lambda>
  File "<stdin>", line 59, in <lambda>
  File "<stdin>", line 65, in <lambda>
  File "<stdin>", line 59, in <lambda>
  File "<stdin>", line 64, in <lambda>
  File "<stdin>", line 57, in <lambda>
NameError: name 'raw_input' is not defined

from this code:
https://gist.github.com/brool/1679908
why?

earnest wing
#

because raw_input is python2 lol

floral meteor
#

!e ```py
def protect(*A):
def D(f):
protected={k:globals()[k]for k in A}
def wrapper(*args, **kwargs):
g = globals();previous={k:g[k]for k in A if k in A};g.update({k:protected[k]for k in A});e=None
try:out = f(args, **kwargs)
except Exception as r:e=r
[k in previous and(g.update({k:previous[k]})or 1)or(g.pop(k))for k in A]
if e is not None:raise e
else:return out
return wrapper
return D
a=42
@protect("a")
def multiply(n):return a
n
print(multiply(10))
a=10
print(multiply(10))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | 420
002 | 420
floral meteor
#

explain, that hurt brain

#

I explicitly make a equal 10 but it stays at 42

snow beacon
#

You set it, then set it back whenever you call the decorated multiply function.

#

When protect("a")(...) is called, a gets stored. When the function it returns is called, it sets a to the stored value.

floral meteor
#

noice

#

!e ```py
import sys
class _self_reference():
def call(self,args):f=lambda a:None;f.code=sys._getframe(1).f_code;return f(args)
def getitem(self,n):return lambda
args:[((f:=(lambda
a:None)).setattr("code",sys._getframe(n+1).f_code)),f]1
self = _self_reference()
fac=lambda n:n<=1 and 1 or n
self(n-1)
print(fac(4),fac(2),fac(3),fac(5))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

24 2 6 120
floral meteor
#

oooh

#

!e ```py
import sys
class _self_reference():
def call(self,args):f=lambda a:None;f.code=sys._getframe(1).f_code;return f(args)
def getitem(self,n):return lambda
args:[((f:=(lambda
a:None)).setattr("code",sys._getframe(n+1).f_code)),f]1
self = _self_reference()
fac=lambda n:n<=1 and 1 or n
self(n-1)
print(fac(320))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

21161033472192524829557170410776298658794639108376130676557783015578090330844472167861788371083170940722591241807108382859295872641348645166391260040395583908986502774347856154314632614857393087562331369896964916313777278292965202780626304839725254323083321245935920345445760469315716688808181386083935737705284353395869520861742156127496385090743602309049820934917134755461873012945704938955132724663075880436995904093654709349552656965610546540372048421026608925808493978164019986593442564905462745669412326023291812269608558332157759989142549649265359278848084868920655698461242425344000000000000000000000000000000000000000000000000000000000000000000000000000000
floral meteor
#

alright how does that one work?

thin trout
#

Altering call frames, it seems like

sudden willow
#

!e (eval(eval(print("test"))))

night quarryBOT
#

@sudden willow :x: Your eval job has completed with return code 1.

001 | test
002 | Traceback (most recent call last):
003 |   File "<string>", line 1, in <module>
004 | TypeError: eval() arg 1 must be a string, bytes or code object
snow beacon
#

print returns None.

snow beacon
toxic jewel
#

!e (eval(str(eval(print("test")))))

night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 | test
002 | Traceback (most recent call last):
003 |   File "<string>", line 1, in <module>
004 | TypeError: eval() arg 1 must be a string, bytes or code object
frozen holly
#

if you have bytecode in a string, is it possible to execute it within the program?

distant wave
#

@frozen holly

desert violet
#

True esoteric python would be reading .png files structured like .jpg files as bytes that are convered into code, compressed into a .zip, reread again as bits, and used as a seed value that tells a code generator what Java code it should put into memory

sick hound
#

!e ```py
x = print("hello world")
print(x if x is not None else "None")

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | hello world
002 | None
sick hound
floral meteor
#

@snow beacon wherever I find code, and for whatever reason, i like to know how and why it works before I use it.
For example:

print(eval(''.join([....__ge__(()).__str__()[this]for this in(0,1,~3,~4)])))
snow beacon
#

That's None, right?

floral meteor
#

Yes

snow beacon
#

Wait, gl? Is that a comparison operator?

floral meteor
#

Yes

#

But in dunder form it returns NotImplemented

snow beacon
#

I thought it was gt.

floral meteor
#

Wait...

#

It's supposed to be ge

snow beacon
#

Or that.

floral meteor
#

Yeah that

#

gl would be ne

#

So it strings, then accesses those indices, which spells None, then evals

dark loom
#

!e py print(eval(''.join([....__ge__(()).__str__()[this]for this in(0,1,~3,~4)])))

night quarryBOT
#

@dark loom :white_check_mark: Your eval job has completed with return code 0.

None
dark loom
#

yo what

#

!e py print(eval(''.join([....__le__(()).__str__()[this]for this in(0,1,~3,~4)])))

night quarryBOT
#

@dark loom :white_check_mark: Your eval job has completed with return code 0.

None
dark loom
#

I am confuz

floral meteor
#

can you see the data go brrrr?

#

@dark loom

>>> ...
Ellipsis
>>> ....__le__(())
NotImplemented
>>> ....__le__(()).__str__()
'NotImplemented'
>>> ....__le__(()).__str__()[:1]
'No'
>>> [....__le__(()).__str__()[this]for this in(0,1,~3,~4)]
['N','o','n','e']
>>> ''.join(_)
'None'
>>> eval(_)
>>> str(_)
"None"
>>> ~3
-4
dark loom
#

ohhh

#

so wait

floral meteor
#

...<=() is not implemented

dark loom
#

!e py print(eval(''.join([....__le__(()).__str__()[this]for this in(0,2,~3,~4)])))

night quarryBOT
#

@dark loom :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1, in <module>
004 | NameError: name 'Ntne' is not defined
dark loom
#

nice

floral meteor
#

0,1 not 0,2

dark loom
#

ik

floral meteor
#

Ntne isn't anything

dark loom
#

I wanted to do that to see what would happen lol

floral meteor
#

if Ntne was defined....

dark loom
#

right right

floral meteor
#

!e ```py
Ntne=4
print(eval(''.join([....le(()).str()[this]for this in(0,2,~3,~4)])))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

4
dark loom
#

I could just remove the eval?

#

and then it would print ntne I think?

floral meteor
#

yeah

#

!e ```py
print((''.join([....le(()).str()[this]for this in(0,2,~3,~4)])))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

Ntne
dark loom
#

!e py print(eval(''.join([....__le__(()).__str__()[this]for this in(0,2,~3,~4)])))

night quarryBOT
#

@dark loom :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 |   File "<string>", line 1, in <module>
004 | NameError: name 'Ntne' is not defined
dark loom
#

if I actually removed the eval

floral meteor
#

lel

dark loom
#

... well you clearly know a lot more about this language than I do lol

#

"~3" you've already lost me

next flame
#

~ is bitwise not

dark loom
#

3 = 0011, so negating is 1100, where the first bit is a signed bit? e.g. -4?

floral meteor
#
>>> ~3
-4
>>> ~1
-2
>>> ~-1
0
>>> ~0
-1
>>> ~2
-3
next flame
#

-x-1 iirc

floral meteor
#

yes

#

although it goes by two's compliment

#

so yes

dark loom
#

so if I did ~16

floral meteor
#

-17

dark loom
#

!e py print(~3)

#

!e py print(~16)

night quarryBOT
#

@dark loom :white_check_mark: Your eval job has completed with return code 0.

-17
dark loom
#

neat

floral meteor
#
>>> my_list[~a]==reversed(my_list)[a]
True
dark loom
#

oo, neat

#

so wait though

#

how did you get -17

floral meteor
#

-16-1

dark loom
#

16 = 0001 0000

floral meteor
#

-17 = 1110 1111 because twos compliment

#

!e print( 16 | -17 )

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

-1
dark loom
#

I'm so confused lol

floral meteor
#

see all 1s means -1

dark loom
#

leading 1s you mean?

floral meteor
#

all the ones

#

ALL OF THEM

#

ONES

#

means -1

dark loom
#

um ok

#

so like... -1-1-10 -1-1-1-1?

#

(obviously not real)

floral meteor
#

you 'plus' 1 to 1111 1111, you get 1 0000 0000 but because the ~9th index does not exist in memory, that doesn't get switched so it becomes 0000 0000

dark loom
#

right, with you so far

floral meteor
#

hence why you 'minus' one from 0000 0000 the machine copes by pretending there's a 1 0000 0000 and makes 1111 1111

dark loom
#

right

#

OH

#

ok I think I get it

floral meteor
#

can't remember why it's called two's compliment but that's what it does

dark loom
#

sooo, basically you reverse it, add 1 to that binary number, and make it negative

#

e.g. 32 | -33 = -1

floral meteor
#

yeah, that's the binary or operator, not to be confuse with the python keyword or

dark loom
#

right

#

or the c++ or operator, ||

#

:p

floral meteor
#

if you compare a | ~a it will return -1

dark loom
#

I'm familiar with bitwise operations, it's been a while since I learned 2s compliments though

floral meteor
#

!e ```py
print(4||5)

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 1
002 |     print(4||5)
003 |             ^
004 | SyntaxError: invalid syntax
floral meteor
#

huh

dark loom
#

it was taught to me different

floral meteor
#

k

#

yeah

dark loom
#

this way is more straightforward

#

so thanks :p

floral meteor
#

|| in matlab is equivalent to or in python, but it isn't lazy in matlab

#

the laziness of or in python can be exploited

#

because we're in #esoteric-python we're gonna exploit that to put everything on one line

dark loom
#

lol

floral meteor
#

for example...

#

!e ```py
((rand:=import('random').randint)(0,2)and print('a'))or print('b');((rand:=import('random').randint)(0,2)and print('a'))or print('b');((rand:=import('random').randint)(0,2)and print('a'))or print('b');((rand:=import('random').randint)(0,2)and print('a'))or print('b')

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | b
002 | b
003 | a
004 | b
005 | b
dark loom
#

we should have a channel called obfuscated-python to obfuscate which channel to use

floral meteor
#

but obfuscated python is a subset of esoteric python

dark loom
#

is the __import__('random') equivalent to import random

floral meteor
#

it's not necessarily esoteric to be confused, but confused is esoteric

#

yes

#

but in expression form

dark loom
#

can you also call something like:
(import random).randInt

#

just curious

floral meteor
#

no

#

that would be...

#

!e ```py
print((random:=import('random')).randint)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

<bound method Random.randint of <random.Random object at 0x5587a3a583c0>>
dark loom
#

!e py print((random:=__import__('random')).randint(0,10))

night quarryBOT
#

@dark loom :white_check_mark: Your eval job has completed with return code 0.

1
twilit grotto
#

i mean, you literally just used the dunder import

floral meteor
#

yes

twilit grotto
#

__import__('random').randint

dark loom
#

whenever someone says that my mind immediately jumps to dunder mifflin

#

I assume that's the name for the weird looking import

floral meteor
#

!e ```py
print((random:=import('random')).randint(0,10),random.sample([0,1,2,3,4,5,6,7,8,9],1)[-0])

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

10 4
dark loom
#

lol it was just by chance they were the same

floral meteor
#

haha negative 0

dark loom
#

8 [8]

floral meteor
#

yes

dark loom
#

!e py import random print(random.sample([0,1,2,3,4,5,6,7,8,9], 5))

night quarryBOT
#

@dark loom :warning: Your eval job has completed with return code 0.

[No output]
dark loom
#

uhhh

#

oh

floral meteor
#

!e print(import('random').sample([0,1,2,3,4,5,6,7,8,9], 5))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

[0, 5, 3, 8, 4]
dark loom
#

!e py import random print(random.sample([0,1,2,3,4,5,6,7,8,9], 5))

night quarryBOT
#

@dark loom :white_check_mark: Your eval job has completed with return code 0.

[1, 0, 4, 9, 7]
dark loom
#

Ah, there it is

#

how did you get that redo button

floral meteor
#

!e ```py
print(int(''.join([str(this)for this in import('random').sample(range(10),5)])))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

47280
floral meteor
#

by editing it really quickly

dark loom
#

ah

floral meteor
#

it has a rapid timeout

dark loom
#

!e py print("hi")

night quarryBOT
#

@dark loom :white_check_mark: Your eval job has completed with return code 0.

hi
dark loom
#

nice

floral meteor
#

somehting like

timeout /t 5
__import__('time').sleep(5)
pause(5)
#

or whatever the equivalent is in whatever language they're coding in

dark loom
#

I would be surprised if it was anything other than python

floral meteor
#
now=(time:=__import__('time').time)();{None for _ in iter(lambda:time()-5<now,False)}
#

the obfuscated version of....
!e ```py

import time

wait = time.sleep

this_long = 5

wait(this_long)

#

did it work?

#

that's a lot more than 5 seconds

#

oh

#

!e ```py
import time

wait = time.sleep

this_long = 5

wait(this_long)

night quarryBOT
#

@floral meteor :warning: Your eval job has completed with return code 0.

[No output]
floral meteor
#

thonk

#

why is it still typing?

#

lmao

#

!e ```py
now=(time:=import('time').time)();{print(time())for _ in iter(lambda:time()-20<now,False)}

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | 1611119600.8488405
002 | 1611119600.848934
003 | 1611119600.8489423
004 | 1611119600.8489504
005 | 1611119600.8489554
006 | 1611119600.8489604
007 | 1611119600.8489668
008 | 1611119600.8489728
009 | 1611119600.8489783
010 | 1611119600.8489835
011 | 1611119600.8489895
... (truncated - too many lines)

Full output: too long to upload

floral meteor
#

!e ```py
now=(time:=import('time').time)();{None for _ in iter(lambda:time()-20<now,False)}

#

thonk

night quarryBOT
#

@floral meteor :warning: Your eval job timed out or ran out of memory.

[No output]
floral meteor
#

thonk

#

that wasn't 20 seconds

steep mural
#

Your eval job timed out or ran out of memory.

floral meteor
#

well it didn't run out of memory because it's in a set so it timed out

#

r00d

#

okay so I have some code here

import os
import random, nt
os.system("")


def print_green(func):
    def wrapper(*args, **kwargs):
        print('\033[32m')  # "\033["+str(random.sample([30, 32, 30], 1)[0])+"m", if you want random colours, end='\033[0m'
        try: func(*args, **kwargs)
        except KeyboardInterrupt: print('\033[0m')
        except SystemExit: print('\033[0m')
        finally: print('\033[0m')
    return wrapper

def double_epilepsy(func):
    def wrapper(*args, **kwargs):os.system('color 41')or func(1,*args,epilepsy=1,**kwargs)
    return wrapper

@double_epilepsy
@print_green
def random_text(coloured:bool=False, suppress_special_characters: bool = False, binary: bool = True, spaces: bool = True, tailored_newlines: bool = False,epilepsy=0, *_):
    count = 0;switch=0
    while True:
        count=(tailored_newlines and(count+1%os.get_terminal_size()[0]-10))or 1;this=ord(nt.urandom(1))
        print('\n' if tailored_newlines and not count else random.sample([random.randint(0, 1),chr(this) if this >= 32 and this!=127 or not suppress_special_characters else ' '*(spaces+1),' '*spaces][0 if binary else 1:], 1)[0],
              sep=(coloured and"\033["+str(random.sample([30, 32, 30], 1)[0])+"m" or spaces*' '*random.randint(0,3)),
              end=[(switch:=epilepsy and(switch and os.system('color 14')or os.system('color 41'))or not switch),(coloured and '\033[0m' or '')+(coloured and '\033[32m'or'')][1])
if __name__ == '__main__':
    while not all([(_bin:=input('b>'))]+[this in['0','1']for this in _bin]):print('.')
    random_text(*(bool(int(this))for this in list(_bin)))

For some reason, this makes it flash red and blue, but doesn't print the results until it's interrupted, and even then it takes a long time for a few characters to print, but without the epilepsy it prints rapidly and looks like the matrix, but stays green on black background

#

!e ```py
import os
import random, nt
os.system("")
def random_text(coloured:bool=False, suppress_special_characters: bool = False, binary: bool = True, spaces: bool = True, tailored_newlines: bool = False,epilepsy=0, _):
count = 0;switch=0
while True:
count=(tailored_newlines and(count+1%os.get_terminal_size()[0]-10))or 1;this=ord(nt.urandom(1))
print('\n' if tailored_newlines and not count else random.sample([random.randint(0, 1),chr(this) if this >= 32 and this!=127 or not suppress_special_characters else ' '
(spaces+1),' 'spaces][0 if binary else 1:], 1)[0],
sep=(coloured and"\033["+str(random.sample([30, 32, 30], 1)[0])+"m" or spaces
' 'random.randint(0,3)),
end=[(switch:=epilepsy and(switch and os.system('color 14')or os.system('color 41'))or not switch),(coloured and '\033[0m' or '')+(coloured and '\033[32m'or'')][1])
if name == 'main':random_text(
(bool(int(this))for this in list('111')))

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | ModuleNotFoundError: No module named 'nt'
floral meteor
#

bruh

#

!e print(dir(import('os')))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

['CLD_CONTINUED', 'CLD_DUMPED', 'CLD_EXITED', 'CLD_KILLED', 'CLD_STOPPED', 'CLD_TRAPPED', 'DirEntry', 'EX_CANTCREAT', 'EX_CONFIG', 'EX_DATAERR', 'EX_IOERR', 'EX_NOHOST', 'EX_NOINPUT', 'EX_NOPERM', 'EX_NOUSER', 'EX_OK', 'EX_OSERR', 'EX_OSFILE', 'EX_PROTOCOL', 'EX_SOFTWARE', 'EX_TEMPFAIL', 'EX_UNAVAILABLE', 'EX_USAGE', 'F_LOCK', 'F_OK', 'F_TEST', 'F_TLOCK', 'F_ULOCK', 'GRND_NONBLOCK', 'GRND_RANDOM', 'GenericAlias', 'MFD_ALLOW_SEALING', 'MFD_CLOEXEC', 'MFD_HUGETLB', 'MFD_HUGE_16GB', 'MFD_HUGE_16MB', 'MFD_HUGE_1GB', 'MFD_HUGE_1MB', 'MFD_HUGE_256MB', 'MFD_HUGE_2GB', 'MFD_HUGE_2MB', 'MFD_HUGE_32MB', 'MFD_HUGE_512KB', 'MFD_HUGE_512MB', 'MFD_HUGE_64KB', 'MFD_HUGE_8MB', 'MFD_HUGE_MASK', 'MFD_HUGE_SHIFT', 'Mapping', 'MutableMapping', 'NGROUPS_MAX', 'O_ACCMODE', 'O_APPEND', 'O_ASYNC', 'O_CLOEXEC', 'O_CREAT', 'O_DIRECT', 'O_DIRECTORY', 'O_DSYNC', 'O_EXCL', 'O_LARGEFILE', 'O_NDELAY', 'O_NOATIME', 'O_NOCTTY', 'O_NOFOLLOW', 'O_NONBLOCK', 'O_PATH', 'O_RDONLY', 'O_RDWR', 'O_RSYNC', 'O_SYNC', 'O_TMPFILE
... (truncated - too long)

Full output: https://paste.pythondiscord.com/huyejicizu.txt

floral meteor
#

!e ```py
import os
import random
nt=os
os.system("")
def random_text(coloured:bool=False, suppress_special_characters: bool = False, binary: bool = True, spaces: bool = True, tailored_newlines: bool = False,epilepsy=0, _):
count = 0;switch=0
while True:
count=(tailored_newlines and(count+1%os.get_terminal_size()[0]-10))or 1;this=ord(nt.urandom(1))
print('\n' if tailored_newlines and not count else random.sample([random.randint(0, 1),chr(this) if this >= 32 and this!=127 or not suppress_special_characters else ' '
(spaces+1),' 'spaces][0 if binary else 1:], 1)[0],
sep=(coloured and"\033["+str(random.sample([30, 32, 30], 1)[0])+"m" or spaces
' 'random.randint(0,3)),
end=[(switch:=epilepsy and(switch and os.system('color 14')or os.system('color 41'))or not switch),(coloured and '\033[0m' or '')+(coloured and '\033[32m'or'')][1])
if name == 'main':random_text(
(bool(int(this))for this in list('011')))

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

 110ã001%´01=N0  *1 [1Ó 1 111 1       0 úC1  11 0O1110 y0     1,š a    1  0       0 ú¡ù0I0 1 001  g 000}   G 1 ø  0 0±v 1   n 1+1101 1 1   01101!11 1 [rî  Ÿ ¦0     10 ¬0011 Ñ0   0 00101> 0   s >1 0ì0   ä 1   0    00½­„  0lê1X« T÷— 100~ Lä01§0 0$  0 01 UTHWN3– 0× 0zF  1   Èm1° yþö‹² 0Ü 0  0û  0 01õ  h å0ú v¬ ‘  N01— 1´  Z0|1   00w010    0+&Ê 0 0 10  0 00  B  Ò    0 ‰@0 00 01 \0 11ï   1  N0ú­1¿  0 0 91A .]»11  D0¸ 0  1010   ‹ 110 ù01000 0%Ý fªú    þ 0  î û0  01  10   ¨ ¥17* 1— àh  0  0 ù11     1 01  r1½1 1öD œ00 01 1  0é ¢¸ óë01 0  {   0 0  h 0å01  101áu0101  ã—b0 01*11 101   Õ111   0f´  ˜ 0 1Úß  10 ’10 ¿ Œ 0010  1 0Î00ƒ0   ýÐ11ɶ œ0110£×0)1   _ 1 1 0   t|0=0l  ù1  10 00 21101⠓ 900Ÿ z1k*4\01     z 0Ì  0 00 1¦Ö0    Ÿ  1\å  1 1 î  1   ¡`ã 00, K 1˚\ô ­  000Ô   ;11 0  0 0 0 0  g  0Ø01\ Ë11     0Á·0ø   00 11á ?10   J Z 0„0‰    18  1_ 11   G1É1      µ 1  þ ^R 11 y0+   010?ý  1010b¡0  0ô  q Ê 0 00  _10 1  ; 1Ç1   1©101N‡  0ûG7 0¨eè¶m   1U11K  00  d1 01 1 0fä1q/     0ýp11    1 00 B1 1| 0Ù
... (truncated - too long)

Full output: too long to upload

floral meteor
#

code goes brrrrrrrrrrrrrrrrrrrrrrrrr

sick hound
#

!e ```py
for _ in type("",(),{"iter":lambda s:s,"next":lambda s:1})():
print(_)

weird while True loop i guess
night quarryBOT
#

@sick hound :x: Your eval job timed out or ran out of memory.

001 | 1
002 | 1
003 | 1
004 | 1
005 | 1
006 | 1
007 | 1
008 | 1
009 | 1
010 | 1
011 | 1
... (truncated - too many lines)

Full output: too long to upload

floral meteor
#

!e ```py
print(import('os').system("color 41"))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

-1
floral meteor
#

-1?

#

wtf

sick hound
#

!e ```py
[x for x in type("",(),{"iter":lambda s:s,"next":lambda s:1})()]

night quarryBOT
#

@sick hound :warning: Your eval job timed out or ran out of memory.

[No output]
floral meteor
#

print it

sick hound
#

no

floral meteor
#

:P

#

!e ```py
{print(_) for _ in type("",(),{"iter":lambda s:s,"next":lambda s:1})()}

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | 1
002 | 1
003 | 1
004 | 1
005 | 1
006 | 1
007 | 1
008 | 1
009 | 1
010 | 1
011 | 1
... (truncated - too many lines)

Full output: too long to upload

floral meteor
#

try that

sick hound
#

lol

#
type("",(),{"__iter__":lambda s:s,"__next__":lambda s:1})()

can i even golf this further?

#

i'm not sure if there's something i can inherit

#

to remove the __iter__

floral meteor
#

if you want something to golf, I would love this to be shorter:

print([(_getpass:=__import__('getpass').getpass),(_p:=[]),{(print("PASSWORDS DO NOT MATCH, YOU FOOL"),_p.pop(()==()),_p.pop(()!=()))for _ in iter((lambda:[_p.append(_getpass('new password>')),_p.append(_getpass('confirm password>')),_p[~([]!=[])]==_p[~([]==[])]][2]),True)},_p[~([]!=[])]][2])
sick hound
#

im not that good at golfing lol

snow beacon
#

Can you not just do iter(lambda:1,0)?

sick hound
floral meteor
#

!e ```py
{print(_)for _ in iter(lambda:1,0)}

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | 1
002 | 1
003 | 1
004 | 1
005 | 1
006 | 1
007 | 1
008 | 1
009 | 1
010 | 1
011 | 1
... (truncated - too many lines)

Full output: too long to upload

floral meteor
#

like that?

snow beacon
#

Aye.

sick hound
#

ohhh

#

huh i never knew about the two argument iter

floral meteor
#

what about my password confirmer?

sick hound
#

interesting

floral meteor
#

it loops while passwords do not match

sick hound
#

how could i make an empty callable that returns None hm

snow beacon
#

It looks obfuscated.

sick hound
#

other than a lambda

snow beacon
#

You can probably replace ()==() with 1, for instance.

#

print technically fits.

floral meteor
#

!e ```py
print([(_getpass:=lambda f:f),(_p:=[]),{(print("PASSWORDS DO NOT MATCH, YOU FOOL"),_p.pop(1),_p.pop(0))for _ in iter((lambda:[_p.append(_getpass('new password>')),_p.append(_getpass('confirm password>')),_p[~0]==_p[~1]][2]),True)},_p[~0]][3])

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | PASSWORDS DO NOT MATCH, YOU FOOL
002 | PASSWORDS DO NOT MATCH, YOU FOOL
003 | PASSWORDS DO NOT MATCH, YOU FOOL
004 | PASSWORDS DO NOT MATCH, YOU FOOL
005 | PASSWORDS DO NOT MATCH, YOU FOOL
006 | PASSWORDS DO NOT MATCH, YOU FOOL
007 | PASSWORDS DO NOT MATCH, YOU FOOL
008 | PASSWORDS DO NOT MATCH, YOU FOOL
009 | PASSWORDS DO NOT MATCH, YOU FOOL
010 | PASSWORDS DO NOT MATCH, YOU FOOL
011 | PASSWORDS DO NOT MATCH, YOU FOOL
... (truncated - too many lines)

Full output: too long to upload

sick hound
#

could i make lambda:1 any shorter?

#

lmao

#

is there like a built-in function i can use

floral meteor
#

!e ```py
print([(_getpass:=lambda f:"SUPER SECRET PASSWORD"),(_p:=[]),{(print("PASSWORDS DO NOT MATCH, YOU FOOL"),_p.pop(1),_p.pop(0))for _ in iter((lambda:[_p.append(_getpass('new password>')),_p.append(_getpass('confirm password>')),_p[~0]==_p[~1]][2]),True)},_p[~0]][3])

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

SUPER SECRET PASSWORD
sick hound
#

that is less than 8 chars long

floral meteor
#

you see how it works?

sick hound
#

OH

#

i found one

floral meteor
#

just replace the lambda f:<password> with __import__('getpass').getpass because you can't input to the bot

sick hound
#

holy shit

#

iter(set,0)

#

LMAO thats so tiny

floral meteor
#

!e {print(_)for _ in iter(set,0)}

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | set()
002 | set()
003 | set()
004 | set()
005 | set()
006 | set()
007 | set()
008 | set()
009 | set()
010 | set()
011 | set()
... (truncated - too many lines)

Full output: too long to upload

floral meteor
#

lol

sick hound
#

i would use id() to save one char but that takes an argument

floral meteor
#

!e print(id(1))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

140681298794800
sick hound
#

yea but i need the 1

#

which increases a char

#

and brings me back to the same place

floral meteor
#

!e iter(1,0)

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: iter(v, w): v must be callable
sick hound
#

yea

#

int isn't callable

floral meteor
#

!e ```py
class i:call=lambda s:1
{print(_)for _ in iter(i(),0)}

#

lol

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | 1
002 | 1
003 | 1
004 | 1
005 | 1
006 | 1
007 | 1
008 | 1
009 | 1
010 | 1
011 | 1
... (truncated - too many lines)

Full output: too long to upload

sick hound
#

that requires that class tho

floral meteor
#

ye

sick hound
#

plus doesnt save a char in the last line

floral meteor
#

!e ```py
i=type("",(),{'call':lambda s:1})()
{print(_)for _ in iter(i,0)}

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | 1
002 | 1
003 | 1
004 | 1
005 | 1
006 | 1
007 | 1
008 | 1
009 | 1
010 | 1
011 | 1
... (truncated - too many lines)

Full output: too long to upload

floral meteor
#

!e ```py
with open("haha.py",'w')as file:file.write("import os")
print(import('os').system("set PYTHONSTARTUP=$cd/haha.py"))

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | OSError: [Errno 30] Read-only file system: 'haha.py'
floral meteor
#

!e ```py
print(import('os').system("echo import os>haha.py & set PYTHONSTARTUP=$cd/haha.py"))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

-1
floral meteor
#

-1

#

not 1

#

!e ```py
print(os)

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'os' is not defined
floral meteor
#

nope

#

no worky

#

lol

sick hound
#

hey

#

thats what i always say

#

"no worky"

floral meteor
#

protected against shell injection

#

hey that reminds me...

#

once when I had a hobby in theatre, I figured out how to rename the microphone and named it fluffy but the techie then renamed it to no toucy so I renamed it to yestoucy

#

anyway...

sick hound
#

LMAO

floral meteor
#
print(__import__('os').system("echo import os>haha.py & set PYTHONSTARTUP=$cd/haha.py"))

would eliminate the need to import os as it would already be imported, but only in the python shell, not in scripts

#

my bluetooth headphones ran out of battery

sick hound
#

that's why i hate bluetooth headphones

snow beacon
floral meteor
#

now I can't head-bop to intense music therefore I can't code...

snow beacon
#

You could try humming.

floral meteor
#

you see when it reaches 10%, it says low battery about 12 times before it actually runs out of battery

#

and it's louder than the music

#

and it has a chinese accent

snow beacon
#

Alas. I bet there's some way to execute shell commands in snekbox.

floral meteor
#

!e ```py
{print("Low Battery")for _ in range(12)}

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/ehozodifut.txt

sick hound
#

why not list comp?

floral meteor
#

it is, but it's a set

snow beacon
#

Because order doesn't matter.

sick hound
#

yea

floral meteor
#

so it eliminates duplicates

#

so it's memory efficient

#

and less memory writing, so slightly faster

sick hound
#
print(*("Low Battery",)*12,sep="\n")
#

this saves some characters i guess

floral meteor
#

!e print(*["Low Battery"]*12,sep='\n')

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/wawolojoha.txt

floral meteor
#

saves one extra character

sick hound
#

is it actually 1?

#

i thought it saved like 2-3

floral meteor
#

saves the comma

sick hound
#

OH

#

yea thats good

floral meteor
#

!e ```py
print((12*"\nLow Battery")[1:])

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/kudabegoxi.txt

sick hound
#

lol

floral meteor
#

THere, shorter

sick hound
#

!e print((12*"\nLow Battery"))

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | 
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/faxazerozu.txt

sick hound
#

oh

floral meteor
#

!e print(12*"Low Battery\n")

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/yecavokato.txt

sick hound
#

huh

floral meteor
#

!e print('\n'.join(["Low Battery"]*12))

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/equyavifuh.txt

floral meteor
#

!e print('\n'.join(["Low Battery"]*999999))

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: too long to upload

floral meteor
#

!e {print("Low Battery")for(_)in range(99999999999999999999999999)}

sick hound
#

this code sucks

#

i know how to make it better

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: too long to upload

floral meteor
#

huuuuuuuuuuuuuuuuuuuge number

sick hound
#

!e ```py
print("Low Battery")
print("Low Battery")
print("Low Battery")
print("Low Battery")
print("Low Battery")
print("Low Battery")
print("Low Battery")
print("Low Battery")
print("Low Battery")
print("Low Battery")
print("Low Battery")
print("Low Battery")

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/xalaragigi.txt

sick hound
#

there

#

code is better now

floral meteor
#

lmao

#

!e print("Low Battery")*12

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 | Low Battery
002 | Traceback (most recent call last):
003 |   File "<string>", line 1, in <module>
004 | TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
floral meteor
#

aw

sick hound
#

!e print(12*"Low Battery\n")

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/farepizalo.txt

sick hound
#

so this is as far as we can get?

#

sucks

floral meteor
#

!e print(12*["Low Battery"])

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

['Low Battery', 'Low Battery', 'Low Battery', 'Low Battery', 'Low Battery', 'Low Battery', 'Low Battery', 'Low Battery', 'Low Battery', 'Low Battery', 'Low Battery', 'Low Battery']
sick hound
#

!e print((12["Low Battery"]))

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

Low Battery Low Battery Low Battery Low Battery Low Battery Low Battery Low Battery Low Battery Low Battery Low Battery Low Battery Low Battery
floral meteor
#

I think we're back where we started

sick hound
#

yea lol

#

without the print it would be 12*"Low Battery\n" but that would only work in REPL i guess

#

we need to bring back golfing challenges of the day

#

i would actually look forward to that

floral meteor
#

!e ```py
class h(str):xor=lambda s,n:'\n'.join([s]*n)
l=h("Low Battery")
print(l^12)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/ipumikacos.txt

floral meteor
#

that works? hecc

sick hound
#

making classes is cool but i think they count in the golf too

floral meteor
#

yeah

#

!e ```py
class twisted_int(int):xor,pow=lambda s,n:int.pow(s,n),lambda s,n:int.xor(s,n)
print(twisted_int(4)^2)

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

16
sick hound
#

!e ```py
import random

class Maybe:
def bool(self):
return random.choice(True, False)

Maybe = Maybe()

if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 9, in <module>
003 |   File "<string>", line 5, in __bool__
004 | TypeError: choice() takes 2 positional arguments but 3 were given
sick hound
#

o

#

!e ```py
import random

class Maybe:
def bool(self):
return random.choice([True, False])

Maybe = Maybe()

if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

Maybe this will be printed.
sick hound
#

!e ```py
import random

class Maybe:
def bool(self):
return random.choice([True, False])

Maybe = Maybe()

if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
sick hound
#

lol

#

i should probably inherit that off bool

#

!e ```py
import random

class Maybe:
def init(self):
self = random.choice((True, False))

Maybe = Maybe()

if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

Maybe this will be printed.
sick hound
#

wait that actually works?

#

i didn't expect it to work

#

!e ```py
import random

class Maybe:
def new(cls):
return random.choice((True, False))

Maybe = Maybe()

if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
sick hound
#

this is probably better

floral meteor
#

!e ```py
class Maybe:bool=lambda s:import('random').choice([[]==[],[]!=[]])
[Maybe()and print("this might be printed")or print("[No output]") for _ in range(12)]

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | this might be printed
002 | [No output]
003 | this might be printed
004 | [No output]
005 | this might be printed
006 | [No output]
007 | [No output]
008 | [No output]
009 | this might be printed
010 | [No output]
011 | [No output]
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/wadeharoso.txt

sick hound
#

haha

#

watch this

#

!e ```py
import random

Maybe = type("",(),{"new":random.choice((1,0))})()

if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 3, in <module>
003 | TypeError: 'int' object is not callable
sick hound
#

o

#

sucks

#

!e ```py
import random

Maybe = type("",(),{"new":random.choice((1,0))})

if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

Maybe this will be printed.
sick hound
#

lmao that's actually epic

floral meteor
#

you still gotta call it tho

sick hound
#

it gave an error when i called it

#

idk why

#

!e ```py
Maybe = type("",(),{"new":import("random").choice([1,0])})

if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

Maybe this will be printed.
floral meteor
#

!e ```py
class Maybe:bool=call=lambda s:import('random').choice([[]==[],[]!=[]])
[Maybe()and print("this might be printed")for _ in range(24)]

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | this might be printed
002 | this might be printed
003 | this might be printed
004 | this might be printed
005 | this might be printed
006 | this might be printed
007 | this might be printed
008 | this might be printed
009 | this might be printed
010 | this might be printed
sick hound
#

"might be printed"

floral meteor
#

10 lines for 24 iterations

sick hound
#

huh

#

!e ```py
Maybe = type("",(),{"new":import("random").choice([1,0])})

for _ in range(10):
if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | Maybe this will be printed.
002 | Maybe this will be printed.
003 | Maybe this will be printed.
004 | Maybe this will be printed.
005 | Maybe this will be printed.
006 | Maybe this will be printed.
007 | Maybe this will be printed.
008 | Maybe this will be printed.
009 | Maybe this will be printed.
010 | Maybe this will be printed.
sick hound
#

ay wtf

#

!e ```py
Maybe = type("",(),{"new":import("random").choice([1,0])})

for _ in range(100):
if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | Maybe this will be printed.
002 | Maybe this will be printed.
003 | Maybe this will be printed.
004 | Maybe this will be printed.
005 | Maybe this will be printed.
006 | Maybe this will be printed.
007 | Maybe this will be printed.
008 | Maybe this will be printed.
009 | Maybe this will be printed.
010 | Maybe this will be printed.
011 | Maybe this will be printed.
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/tucefaziqu.txt

sick hound
#

why are there 100 lines :(

floral meteor
#

!e ```py
class Maybe:bool=call=lambda s:import('random').choice([[]==[],[]!=[]])
[Maybe()()and print("this might be printed")for _ in range(24)]

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | this might be printed
002 | this might be printed
003 | this might be printed
004 | this might be printed
005 | this might be printed
006 | this might be printed
007 | this might be printed
008 | this might be printed
009 | this might be printed
010 | this might be printed
011 | this might be printed
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/osimajivut.txt

sick hound
#

code no worky

#

!e ```py
Maybe = type("",(),{"new":import("random").choice([1,0])})()

for _ in range(100):
if Maybe:
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: 'int' object is not callable
floral meteor
#

double call

sick hound
#

how!

abstract widget
#

Maybe has the same value everytime

sick hound
#

i never called it the first time

abstract widget
#

Maybe is a class

abstract widget
#

class is True

#

Maybe

#

hhhhhhhh

sick hound
#

yeah

#

but it raises an error when i call it

#

damn python confusing

#

reject humanity go back to monke

#

!e bool(type)

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
sick hound
#

!e print(bool(type))

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

True
sick hound
#

yea

#

makes sense

#

!e ```py
Maybe = type("",(),{"new":import("random").choice([1,0])})()

for _ in range(100):
if Maybe():
print("Maybe this will be printed.")

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: 'int' object is not callable
sick hound
#

so confused

#

!e ```py
Maybe = type("",(),{"new":import("random").choice([1,0])})()

for _ in range(100):
print(Maybe)

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: 'int' object is not callable
abstract widget
#

you are calling

sick hound
#

!e ```py
Maybe = type("",(),{"new":import("random").choice([1,0])})

for _ in range(100):
print(Maybe)

abstract widget
#

it in the first line

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | <class '__main__.'>
002 | <class '__main__.'>
003 | <class '__main__.'>
004 | <class '__main__.'>
005 | <class '__main__.'>
006 | <class '__main__.'>
007 | <class '__main__.'>
008 | <class '__main__.'>
009 | <class '__main__.'>
010 | <class '__main__.'>
011 | <class '__main__.'>
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/amufumagox.txt

sick hound
#

so that's type

#

why is it type tho

#

how am i supposed to instance it it wont let me

abstract widget
#

!e

Maybe = type("",(),{"__new__":__import__("random").choice([1,0])})

for _ in range(100):
    if Maybe():
        print('hi')
night quarryBOT
#

@abstract widget :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 4, in <module>
003 | TypeError: 'int' object is not callable
abstract widget
#

wtf

sick hound
#

ik!!!

abstract widget
#

hahahaha

#

oh

floral meteor
#

!e ```py
class Preposterous:call=lambda s:s;str=bool=import('random').choice([[]==[],[]!=[]])
print(Preposterous()()()()()()()()()()()()()()if Preposterous()()()()else Preposterous())

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | TypeError: 'bool' object is not callable
floral meteor
#

oh

sick hound
#

!e ```py
Maybe = type("",(),{"new":import("random").choice([1,0])})

for _ in range(100):
print(Maybe.new())

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 4, in <module>
003 | TypeError: 'int' object is not callable
sick hound
#

crying rn

#

python hard

abstract widget
#

!e

Maybe = type("",(),{"__new__":__import__("random").choice([1,0])})

for _ in range(100):
    if Maybe:
        print('hi')
night quarryBOT
#

@abstract widget :white_check_mark: Your eval job has completed with return code 0.

001 | hi
002 | hi
003 | hi
004 | hi
005 | hi
006 | hi
007 | hi
008 | hi
009 | hi
010 | hi
011 | hi
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/jugexequno.txt

sick hound
#

prints 100 times

abstract widget
#

hmm

sick hound
#

probably because of

#

!e print(bool(type))

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

True
sick hound
#

omg chilaxan is the savior

rugged sparrow
#

You aren't setting new to a function

sick hound
#

fuck

rugged sparrow
#

Your setting it to a number

sick hound
#

!e ```py
Maybe = type("",(),{"new":lambda c:import("random").choice([1,0])})

for _ in range(100):
print(Maybe)

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | <class '__main__.'>
002 | <class '__main__.'>
003 | <class '__main__.'>
004 | <class '__main__.'>
005 | <class '__main__.'>
006 | <class '__main__.'>
007 | <class '__main__.'>
008 | <class '__main__.'>
009 | <class '__main__.'>
010 | <class '__main__.'>
011 | <class '__main__.'>
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/uvuguceluq.txt

sick hound
#

!e ```py
Maybe = type("",(),{"new":lambda c:import("random").choice([1,0])})

for _ in range(100):
print(Maybe())

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 0
003 | 0
004 | 0
005 | 0
006 | 0
007 | 1
008 | 1
009 | 1
010 | 0
011 | 0
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/edavusafel.txt

sick hound
#

that's cool

rugged sparrow
#

If you make it bool instead of new then it'll only need one instance of Maybe

floral meteor
#

!e ```py
class Preposterous:call=lambda s:s;bool=lambda c:import("random").choice([True,False])
print(Preposterous()()()()()()()()()()()()()()()()()()()())

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

<__main__.Preposterous object at 0x7f06b88d7fd0>
abstract widget
#

!e

import random

class maybe:
    def __new__(cls):
        return random.choice(range(2))

for _ in range(100):
    if maybe():
        print('hi')
night quarryBOT
#

@abstract widget :white_check_mark: Your eval job has completed with return code 0.

001 | hi
002 | hi
003 | hi
004 | hi
005 | hi
006 | hi
007 | hi
008 | hi
009 | hi
010 | hi
011 | hi
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/wifiqibehi.txt

sick hound
#
['__abs__', '__add__', '__and__', '__bool__', '__ceil__', '__class__', '__delattr__', '__dir__', '__divmod__', '__doc__', '__eq__', '__float__', '__floor__', '__floordiv__', '__format__', '__ge__', '__getattribute__', '__getnewargs__', '__gt__', '__hash__', '__index__', '__init__', '__init_subclass__', '__int__', '__invert__', '__le__', '__lshift__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__or__', '__pos__', '__pow__', '__radd__', '__rand__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__', '__rlshift__', '__rmod__', '__rmul__', '__ror__', '__round__', '__rpow__', '__rrshift__', '__rshift__', '__rsub__', '__rtruediv__', '__rxor__', '__setattr__', '__sizeof__', '__str__', '__sub__', '__subclasshook__', '__truediv__', '__trunc__', '__xor__', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'numerator', 'real', 'to_bytes']

want to keep this

abstract widget
#

!e

import random

class maybe:
    def __bool__(self):
        return random.choice(range(2))

maybe = maybe()

for _ in range(100):
    if maybe:
        print('hi')
night quarryBOT
#

@abstract widget :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 10, in <module>
003 | TypeError: __bool__ should return bool, returned int
abstract widget
#

!e

import random

class maybe:
    def __bool__(self):
        return bool(random.choice(range(2)))

maybe = maybe()

for _ in range(100):
    if maybe:
        print('hi')
night quarryBOT
#

@abstract widget :white_check_mark: Your eval job has completed with return code 0.

001 | hi
002 | hi
003 | hi
004 | hi
005 | hi
006 | hi
007 | hi
008 | hi
009 | hi
010 | hi
011 | hi
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/usegumiyum.txt

floral meteor
#

!e ```py
class Preposterous(bool):call=lambda s:s;bool=lambda c:import("random").choice([True,False]);str=lambda s:s and "True" or "False"
print([Preposterous()()()()()()()()()()()()()()()()()()()()for _ in range(24)])

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: type 'bool' is not an acceptable base type
floral meteor
#

that's just not acceptable

sick hound
#

!e ```py
Maybe = type("",(),{"new":lambda c:import("random").choice([1,0])})

for _ in iter(Maybe, 0):
print(_)

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
sick hound
#

!e ```py
Maybe = type("",(),{"new":lambda c:import("random").choice([1,0])})

for x in iter(Maybe, 1):
print(x)

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 0
003 | 0
004 | 0
005 | 0
sick hound
#

that's cool

#

!e ```py
Maybe = type("",(),{"new":lambda c:import("random").choice([1,0])})

[print(x) for x in [Maybe] * 100 if x]

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | <class '__main__.'>
002 | <class '__main__.'>
003 | <class '__main__.'>
004 | <class '__main__.'>
005 | <class '__main__.'>
006 | <class '__main__.'>
007 | <class '__main__.'>
008 | <class '__main__.'>
009 | <class '__main__.'>
010 | <class '__main__.'>
011 | <class '__main__.'>
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/ecilojovuf.txt

sick hound
#

!e ```py
Maybe = type("",(),{"new":lambda c:import("random").choice([1,0])})

[print(x) for x in [Maybe()] * 100 if x]

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
abstract widget
#

!e

maybe = type("",(),{"__bool__":lambda x: bool(__import__("random").choice([1,0]))})()

for i in range(100):
    if maybe:
        print(i)
night quarryBOT
#

@abstract widget :white_check_mark: Your eval job has completed with return code 0.

001 | 0
002 | 2
003 | 5
004 | 6
005 | 8
006 | 9
007 | 10
008 | 11
009 | 12
010 | 13
011 | 15
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/nowimiheto.txt

abstract widget
#

!e

maybe = type("",(),{"__bool__":lambda x: bool(__import__("random").choice(range(2)))})()

for i in range(100):
    if maybe:
        print(i)
night quarryBOT
#

@abstract widget :white_check_mark: Your eval job has completed with return code 0.

001 | 1
002 | 2
003 | 3
004 | 5
005 | 6
006 | 12
007 | 14
008 | 15
009 | 17
010 | 18
011 | 20
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/pihidufiwi.txt

abstract widget
#

oh i have an evil idea

#

hahah

sick hound
#
Maybe = type("",(),{"__new__":lambda c:__import__("random").choice([1,0])})

how to make so it no use ()

#

no making object

#

or else it bad and no worky

#

going to look at more Maybe code

abstract widget
#

that what i'm about to do

floral meteor
#

!e ```py
class Marco:call=lambda _:print("Polo")or _;
Marco()()()()()()()()()()()()()()()()()()()()()()()()

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Polo
002 | Polo
003 | Polo
004 | Polo
005 | Polo
006 | Polo
007 | Polo
008 | Polo
009 | Polo
010 | Polo
011 | Polo
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/wefahotite.txt

floral meteor
#

I'd call that esoteric

sick hound
#

!e

Test = type("",(),{"__call__":lambda s:s})
x = Test()()()()()()()()()()()()
print(x)
night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

<__main__. object at 0x7f6b20a70fd0>
sick hound
#

lmao thats actually cool

#

!e

x = type("",(),{"__call__":lambda s:s})()()()()()()()()()()()()
print(x)
night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

<__main__. object at 0x7f4f5f9c7fd0>
floral meteor
#

lol you forgot a bit

sick hound
#

hm?

floral meteor
#
type("",(),{"__call__":lambda s:print("Low Battery")or s})()()()()()()()()()()()()()()()()()()()()()()()()()
sick hound
#

LOW BATTERY LMAO

floral meteor
#

!e type("",(),{"call":lambda s:print("Low Battery")or s})()()()()()()()()()()()()()()()()()()()()()()()()()

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/kavituqeja.txt

sick hound
#

!e ```py
import random

class MaybeMeta(type):
def bool(self):
return random.choice((True, False))

class Maybe(metaclass = MaybeMeta):
...

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
sick hound
#

!e ```py
import random

class MaybeMeta(type):
def bool(self):
return random.choice((True, False))

class Maybe(metaclass = MaybeMeta):
...

for _ in range(50):
print(Maybe)

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | <class '__main__.Maybe'>
002 | <class '__main__.Maybe'>
003 | <class '__main__.Maybe'>
004 | <class '__main__.Maybe'>
005 | <class '__main__.Maybe'>
006 | <class '__main__.Maybe'>
007 | <class '__main__.Maybe'>
008 | <class '__main__.Maybe'>
009 | <class '__main__.Maybe'>
010 | <class '__main__.Maybe'>
011 | <class '__main__.Maybe'>
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/kikefonuku.txt

floral meteor
#

this is why I hate technology

#

!e type("",(),{"call":lambda s:print("Low Battery")or s})()()()()()()()()()()()()()()()()()()()()()()()()()

night quarryBOT
#

@floral meteor :white_check_mark: Your eval job has completed with return code 0.

001 | Low Battery
002 | Low Battery
003 | Low Battery
004 | Low Battery
005 | Low Battery
006 | Low Battery
007 | Low Battery
008 | Low Battery
009 | Low Battery
010 | Low Battery
011 | Low Battery
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/hacanohifu.txt

sick hound
#

!e ```py
import random

class MaybeMeta(type):
def bool(self):
return random.choice((True, False))

class Maybe(metaclass = MaybeMeta):
...

for _ in range(50):
print(bool(Maybe))

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | True
002 | True
003 | True
004 | False
005 | False
006 | False
007 | False
008 | False
009 | False
010 | False
011 | False
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/xenayavomu.txt

sick hound
#

holy shit

#

how does that even work

#

idk what metaclasses are

floral meteor
#

try __str__=lambda s:str(bool(s))

sick hound
#

hm?

#

!e __str__=lambda s:str(bool(s))

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
floral meteor
#

not by itself

#

in the Maybe class

sick hound
#

ahhh

floral meteor
#

that way you can string it to get its boolean value

#
Evil = (
          lambda o:
               setattr(o, '__iter__', lambda x:x)
               or setattr(o, '__next__', lambda x:True)
               or o
       )(type("EvilIterator", (object,), {}))
sick hound
#

!e ```py
import random

class MaybeMeta(type):
def bool(self):
return random.choice((True, False))

class Maybe(metaclass = MaybeMeta):
str = lambda s: str(bool(s))
repr = str
...

for _ in range(50):
print(bool(Maybe))

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | True
002 | True
003 | True
004 | True
005 | True
006 | False
007 | True
008 | False
009 | True
010 | True
011 | False
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/ipozerucop.txt

sick hound
#

wouldn't i place that in the metaclass though?

floral meteor
#

yes

#
(_get_encrypted_token:=lambda:(_t:=(_getpass:=__import__('getpass').getpass)("copy and paste token here (ENTER to skip)>"))and((lambda source,key:(not key)and source or[len(source)<len(key)and(key:=key[:len(source)])or len(source)>len(key)and(key:=(key*(len(source)//len(key)+(()==())))[:len(source)]),(_s:=[ord(c)for(c)in list(source)]),(_k:=[ord(c)for(c)in list(key)]),(_p:=[]),[_p.append((((e-32)+(_k[i]-32))%95)+32)for i,e in enumerate(_s)],''.join([chr(n)for(n)in(_p)])][-1])(_t,[(_p:=[]),{(print("PASSWORDS DO NOT MATCH, YOU FOOL"),_p.pop(()==()),_p.pop(()!=()))for _ in iter((lambda:[_p.append(_getpass('new password>')),_p.append(_getpass('confirm password>')),_p[~([]!=[])]==_p[~([]==[])]][2]),True)},_p[~([]!=[])]][2]))or'')][[]!=[]]
sick hound
#

!e ```py
import random

class MaybeMeta(type):
str = lambda s: str(bool(s))
repr = str
bool = random.choice([True, False])

class Maybe(metaclass = MaybeMeta):
...

for _ in range(50):
print(bool(Maybe))

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 12, in <module>
003 | TypeError: 'bool' object is not callable
sick hound
#

!e ```py
import random

class MaybeMeta(type):
str = lambda s: str(bool(s))
repr = str
bool = random.choice([True, False])

class Maybe(metaclass = MaybeMeta):
...

for _ in range(50):
print(Maybe)

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 12, in <module>
003 |   File "<string>", line 4, in <lambda>
004 | TypeError: 'bool' object is not callable
sick hound
#

!e ```py
import random

class MaybeMeta(type):
str = lambda s: str(bool(s))
repr = str
bool = lambda s: random.choice([True, False])

class Maybe(metaclass = MaybeMeta):
...

for _ in range(50):
print(Maybe)

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

001 | True
002 | False
003 | False
004 | False
005 | False
006 | True
007 | False
008 | False
009 | True
010 | False
011 | False
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/onizetazil.txt

sick hound
#

what does the ... do?

#

!e ...

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
sick hound
#

huh

#

!e print(...)

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

Ellipsis
sick hound
#

tf

#

never knew about that

#

!e type(...)

abstract widget
#

oh

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
abstract widget
#

wow

sick hound
#

!e print(dir(...))

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']
abstract widget
#

<class 'ellipsis'>

sick hound
#

!e ellipsis

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'ellipsis' is not defined
sick hound
#

!e ... < 5

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: '<' not supported between instances of 'ellipsis' and 'int'
sick hound
#

!e help(dir)

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | NameError: name 'help' is not defined
sick hound
#

!e object.new(type("",(),{}))

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
sick hound
#

!e print(object.new(type("",(),{"repr":lambda s:"e"})))

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: type object 'object' has no attribute 'new'
abstract widget
#

!e

wow = Ellipsis()
night quarryBOT
#

@abstract widget :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: 'ellipsis' object is not callable
abstract widget
#

!e

sad = Ellipsis
night quarryBOT
#

@abstract widget :warning: Your eval job has completed with return code 0.

[No output]
sick hound
#

!e print(Ellipsis.class)

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

<class 'ellipsis'>
sick hound
#

!e ```py
Ellipsis.class.new()

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: ellipsis.__new__(): not enough arguments
sick hound
#

!e ```py
Ellipsis.class.new(Ellipsis)

night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | TypeError: ellipsis.__new__(X): X is not a type object (ellipsis)
sick hound
#

!e ```py
Ellipsis.class.new(Ellipsis.class)

night quarryBOT
#

@sick hound :warning: Your eval job has completed with return code 0.

[No output]
sick hound
#

!e ```py
print(Ellipsis.class.new(Ellipsis.class))

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

Ellipsis
sick hound
#

i am so confused

#

i just learned like 3 new things today

abstract widget
#

same

#

hhhhhhhhh

sick hound
#

oh

#

Ellipsis is a literal

#

just like True or False

abstract widget
#
r = [..., 1,2,3] == [Ellipsis, 1,2,3]
print(r)
high garnet
#

yeah

#

it's only used in numpy AFAIK

sick hound
#

yea

abstract widget
#

!e

r = [..., 1,2,3] == [Ellipsis, 1,2,3]
print(r)
sick hound
#

wait so

#

why does Ellipsis exist as a literal, if ... works too

#

!e print(....class)

#

LMFAO

#

that's actually cool

abstract widget
#

python wtf

floral meteor
#

!e ```py
print((_get_encrypted_token:=lambda:(_t:=[(_getpass:=(lambda s:"Password1")),'yhjYwWbY&2a[cw^b\=PDmYx'][1])and((lambda source,key:(not key)and source or[len(source)<len(key)and(key:=key[:len(source)])or len(source)>len(key)and(key:=(key*(len(source)//len(key)+(()==())))[:len(source)]),(_s:=[ord(c)for(c)in list(source)]),(_k:=[ord(c)for(c)in list(key)]),(_p:=[]),[_p.append((((e-32)-(_k[i]-32))%95)+32)for i,e in enumerate(_s)],''.join([chr(n)for(n)in(_p)])][-1])(_t,[(_p:=[]),{(print("PASSWORDS DO NOT MATCH, YOU FOOL"),_p.pop(()==()),_p.pop(()!=()))for _ in iter((lambda:[_p.append(_getpass('new password>')),_p.append(_getpass('confirm password>')),_p[~([]!=[])]==_p[~([]==[])]][2]),True)},_p[~([]!=[])]][2]))or'')())

sick hound
#

im gonna do something very cool with this new knowledge

floral meteor
#

aw

#

oh

sick hound
#
... = type("",(),{"...":lambda s:s})
print(.......)
#

!e

... = type("",(),{"...":lambda s:s})
print(.......)
floral meteor
#

there

sick hound
#

awwwww

#

cannot assign to Ellipsis

#

life ruined

#

!e

Ellipsis = type("",(),{"...":lambda s:s})
print(.......)
#

!e

Ellipsis = type("",(),{"...":lambda s:s})
print(Ellipsis.Ellipsis)
#

!e

Ellipsis = type("",(),{"...":lambda s:s})
print(Ellipsis....)
floral meteor
#

but look at this

exotic venture
#

!e

....__class__.__new__(....__class__).__class__.__new__(....__class__).__class__.__new__(....__class__)
night quarryBOT
#

@exotic venture :warning: Your eval job has completed with return code 0.

[No output]
grave rover
#

how would I make try:except:else: a oneliner?

frigid wharf
#

maybe something like ```py
with type("",(),{"enter":lambda self:1, "exit": lambda self, exception_type, exception_value, exception_traceback: exception_type==ZeroDivisionError and (print(1) or True)})():1/0

earnest wing
#

inline try-except @grave rover

proper vault
#

the idea is to subclass ContextDecorator to call a context manager as an expression

grave rover
#

hmm

#

context managers aren't really the solution since I'm trying to go for expressions rather than statements

earnest wing
#

what i linked is an expression

grave rover
#

awesome, thanks

#

looks like something's going wrong with my obfuscator, hmm...

#
# Generated by Mart Obfuscator
a=[0]*14
a.__setitem__(0,[0]*9)
a.__setitem__(1,lambda b,*c,d=lambda c:c,e=Exception,**f:(g:={}).pop('r',type('',(__import__('contextlib').ContextDecorator,),{'__enter__':int,'__exit__':lambda h,*c:isinstance(c[1],e)and[g.update(r=d(c))]})()(b)(*c,**f)))

check=lambda j:(
    a.__setitem__(2,j%3),
    a.__setitem__(3,j-a[2]),
    a[0][a[2]]==a[0][a[2]+3]==a[0][a[2]+6]and a[0][a[2]]or(
            a[0][a[3]]==a[0][a[3]+1]==a[0][a[3]+1]and a[0][a[3]]or(
            j&1and(a[0][1]==a[0][5]==a[0][9]and a[0][5]or(
            a[0][3]==a[0][5]==a[0][7]and a[0][5]or 0))or 0))
)[-1]

board=lambda:(
    a.__setitem__(4,'│'.join([' '*3]*3)),
    a.__setitem__(5,'┼'.join(['─'*3]*3)),
    a.__setitem__(6,lambda l:[l,'X','O'][a[0][l]]),
    [(
            print(a[4]),
            print('│'.join([f'{a[6](m * 3):^3}',f'{a[6](m * 3 + 1):^3}',f'{a[6](m * 3 + 2):^3}'])),
            print(a[4]),
            m<2and print(a[5]))
        for m in range(3)
    ])

main=lambda:(
    a.__setitem__(7,0),
    a.__setitem__(8,1),
    a.__setitem__(9,0),
    a.__setitem__(10,lambda:(a[7]<9and(not a[9]))and((
        board(),
        a.__setitem__(11,input(f'[Player {a[8]}] Position: ')),
        a.__setitem__(13,lambda:(
            -1,
            a.__setitem__(12,int(a[11])),
            0<=a[12]<=8and(
                    a[0][a[12]]and print('Spot already taken!')or(
                a[0].__setitem__(a[12],a[8]),
                a.__setitem__(9,check(a[12])),
                a.__setitem__(7,a[7]+1),
                a.__setitem__(8,3-a[8])))or 
                print('Invalid answer!'))),
        a[1](a[13],lambda:print('Invalid answer!'),ValueError)),
                                                     a[10]())),
    a[10](),
    board(),
    a[9]==0and print('Draw!')or print(f'Winner: Player {a[9]}')
)

__name__=='__main__' and(
    print('Tic Tac Toe by Martmists'),
    main()
)
#

this is supposed to be tic tac toe, but on input it doesn't seem to check/handle input, can't quite figure out why though

proper vault
#

@grave rover

a[1](a[13],lambda:print('Invalid answer!'),ValueError))
``` calls 
```py
lambda b,*c,d=lambda c:c,e=Exception,**f:(g:={}).pop('r',type('',(__import__('contextlib').ContextDecorator,),{'__enter__':int,'__exit__':lambda h,*c:isinstance(c[1],e)and[g.update(r=d(c))]})()(b)(*c,**f))
```, but the call should probably be
```py
a[1](a[13],d=lambda _:print('Invalid answer!'),e=ValueError))
rugged sparrow
#

@grave rover that exception catching function sends all positional and keyword args that are not directly for it into the func passed as the first arg

#

also while loops would prob be easier to implement with [*iter(func, flag)]

#

instead of recursion

night quarryBOT
#

@rugged sparrow :white_check_mark: Your eval job has completed with return code 0.

001 | [0]
002 | [0, 1]
003 | [0, 1, 2]
004 | [0, 1, 2, 3]
005 | [0, 1, 2, 3, 4]
006 | [0, 1, 2, 3, 4, 5]
007 | [0, 1, 2, 3, 4, 5, 6]
008 | [0, 1, 2, 3, 4, 5, 6, 7]
009 | [0, 1, 2, 3, 4, 5, 6, 7, 8]
010 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
grave rover
#

it seems there's a few more issues to deal with though

rugged sparrow
#

!e ```py
_while = lambda f,c:[*iter(f,type('',(),{'eq':lambda *a:not c()})())]and None

x = []

_while(lambda:x.append(len(x))or print(x), lambda:len(x) < 10)```

night quarryBOT
#

@rugged sparrow :white_check_mark: Your eval job has completed with return code 0.

001 | [0]
002 | [0, 1]
003 | [0, 1, 2]
004 | [0, 1, 2, 3]
005 | [0, 1, 2, 3, 4]
006 | [0, 1, 2, 3, 4, 5]
007 | [0, 1, 2, 3, 4, 5, 6]
008 | [0, 1, 2, 3, 4, 5, 6, 7]
009 | [0, 1, 2, 3, 4, 5, 6, 7, 8]
010 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
timid anchor
#

!e

night quarryBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code
block. Code can be re-evaluated by editing the original message within 10 seconds and
clicking the reaction that subsequently appears.

We've done our best to make this sandboxed, but do let us know if you manage to find an
issue with it!*

timid anchor
#

!e ```py
import random
x = 10
final = []
while x > 0:
c = random.choice('a', 'b', 'c', 'd')
final.append(c)
print(f'{final[0]) {final[1]} {final[2]}')

night quarryBOT
#

@timid anchor :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 7
002 |     print(f'{final[0]) {final[1]} {final[2]}')
003 |                                              ^
004 | SyntaxError: f-string: unmatched ')'
timid anchor
#

mmmmmmmmmmmmmm

#

!e ```py
import random
x = 10
final = []
while x > 0:
c = random.choice('a', 'b', 'c', 'd')
final.append(c)
print(f"{final[0]) {final[1]} {final[2]}")

night quarryBOT
#

@timid anchor :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 7
002 |     print(f"{final[0]) {final[1]} {final[2]}")
003 |                                              ^
004 | SyntaxError: f-string: unmatched ')'
timid anchor
#

hm...

#

oh

#

!e ```py
import random
x = 10
final = []
while x > 0:
c = random.choice('a', 'b', 'c', 'd')
final.append(c)
print(f"{final[0]} {final[1]} {final[2]}")

night quarryBOT
#

@timid anchor :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 5, in <module>
003 | TypeError: choice() takes 2 positional arguments but 5 were given
timid anchor
#

this worked before...

#

weird...

#

!e ```py
import random
x = 10
final = []
while x > 0:
c = random.choice(['a', 'b', 'c', 'd'])
final.append(c)
print(f"{final[0]) {final[1]} {final[2]}")

night quarryBOT
#

@timid anchor :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 7
002 |     print(f"{final[0]) {final[1]} {final[2]}")
003 |                                              ^
004 | SyntaxError: f-string: unmatched ')'
tribal moon
#

#esoteric-python message

Can anyone explain how exactly this works? What I want is it calls os.write() on two numbers, 256, and another really long one that starts with 8, but how does it work? Why does the long number turn into Hello, World!, ? How can I do this with other things?
And is there a Python 3 alternative for this, because os.write() doesn't work like that in Python3

thin trout
#

256 could be the file handle for stdout, while the large number is the integer representation of "Hello, World!"

tribal moon
#

But why is the large number Hello, World!

#

Why is it that exact number, and how is this number formed? How did someone come up with this number and it means Hello World

#

How do I do this with other letters n things

sick hound
#

hey guys im working on another inline code in py but im not sure how to get around this : ```py
@app.route('/')
def app_index():
return render_template('base.html', html='<h1>test</h1>')

rugged sparrow
#

app.route('/')(lambda: render_template('base.html', html='<h1>test</h1>'))

sick hound
#

nevermind

#

just did it as you sent it lmao

#

thanks anyway though

uneven sandal
#
@f1(arg)
@f2
def func(): pass

# is equivalent to
def func(): pass
func = f1(arg)(f2(func))
sick hound
#

i read up on how decorators work

dreamy oracle
#

what's the meaning of app.route('/')

sick hound
#

its a flask thing

dreamy oracle
#

really

sick hound
#

when the url path is '/' it returns whatever is in the func

#

im bad at explaining..

dreamy oracle
#

have you make program ?

sick hound
#

what

dreamy oracle
#

have you make program

#

in python

sick hound
#

yes ive made programs?

#

i havent finished the one im working on now yet though

sick hound
#

finished it... it was surprisingly simple to make it

#

welp anyways heres my one line python flask/socketio live chatroom code:

#

oops it said its over 2k chars

thin trout
sick hound
#

Hm, this isn't exactly related to python, but I was wondering if anyone knew about hacky modules in JavaScript. I just started learning it and was wondering if you could do weird stuff in it like you could in python using inspect, sys, etc.

proper vault
#

You really can't. JS lives in the browser and as such is quite a bit more locked down.

sick hound
#

Damn, that's unfortunate

night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

What is esoteric python
fiery hare
#

!e

ARBITRARY_OBJECT = object()

class HorribleInt(int):
    def __mod__(self, other):
        return ARBITRARY_OBJECT

print(HorribleInt(8) % 2 == 0)
night quarryBOT
#

@fiery hare :white_check_mark: Your eval job has completed with return code 0.

False
fiery hare
#

@formal sandal yay!

formal sandal
#

yes, that's what I meant

fiery hare
#

:DDDDDDDDDDDDDDDD

formal sandal
#

Although no, this wouldn't pass the typechecker

#

because int.__mod__ returns an int

#

So this is enough:

class HorribleInt(int):
    def __mod__(self, other):
        return 42
fiery hare
#

why not 420?

radiant loom
#

not sure if this belongs here

#

''' import tkinter as tk
import datetime

class Countdown(tk.Frame):

def init(self, master):
    super().init(master)
    self.create_widgets()
    self.seconds_left = 0
    self._timer_on = False

def show_widgets(self):

    self.label.pack()
    self.entry.pack()
    self.start.pack() ' ' '

def create_widgets(self):

    self.label = tk.Label(self, text="00:00:00")
    self.entry = tk.Entry(self, justify='center')
    self.entry.focus_set()
    self.start = tk.Button(self, text="Start",
                        command=self.start_button)

def countdown(self):
    self.label['text'] = self.convert_seconds_left_to_time()

    if self.seconds_left:
        self.seconds_left -= 1
        self._timer_on = self.after(1000, self.countdown)
    else:
        self._timer_on = False

def start_button(self):
    # 1. to fetch the seconds
    self.seconds_left = int(self.entry.get)
    # 2. to prevent having multiple
    self.stop_timer()
    # Timers at once
    self.countdown()

def stop_timer(self):

     if self._timer_on:
        self.after_cancel(self._timer_on)
        self._timer_on = False

def convert_seconds_left_to_time(self):

    return datetime.timedelta(seconds=self.seconds_left)

if name == 'main':
root = tk.Tk()
root.resizable(False, False)

countdown = Countdown(root)
countdown.pack()

root.mainloop()
#

the gui doesn't show when I run this timer

snow beacon
#

!code

night quarryBOT
#

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

snow beacon
#

Help with that is probably better suited to other channels though.

radiant loom
#

which channel

#

im honestly not sure

snow beacon
#

This one is for intentionally using bad coding practice. Try one of the help channels.

verbal totem
terse mortar
floral meteor
#

I need help golfing this process, it looks long and messy

async def process_python_command(ctx):
  try:r=("await "in(content:=ctx.content[len(ctx.content.split()[not....__hash__()])+....__eq__(...):]))and(r:=await eval(content.lstrip("await").strip()))or str(r:=eval(content)).startswith("<coroutine")and await r or r;return(r is not None or None)and((_:=r),str(r).startswith("<Message id=")and"exit code 0: Message Object"or str(r).startswith("<Channel id=")and"exit code 0: Channel Object"or str(r).startswith("<Guild id=")and"exit code 0: Guild object"or str(r).lstrip('[').startswith("<Message id=")and f"exit code 0: [Message Object{f's len={r.__len__()}'*(len(r)>(...==...))}]")
  except SyntaxError:return"Exit code 1: INVALID SYNTAX YOU FOOL"
async def python(ctx):global msg;msg=[await ctx.send(this)for this in str(process_python_command(ctx))[0::2000]]
sick hound
#

can't stop walrusing 😳

import os, random, playsound
a = []
for f in os.listdir(os.fsencode((_dir := "music/"))):
    if (b := os.fsdecode(f)).endswith( (".mp3", ".wav") ): a.append(b)
c = lambda: os.system("cls")
while ((lambda y: (_ := playsound.playsound(f"{_dir}{(_ := ((lambda x: [x[(i := random.randrange(len(x)))], c(), print(x[i][:-4])])(a)))[0]}")))(0) != 0): None
floral meteor
#
async def process_system_command(m):
 global msg
 _=[" > B:\\Temp\\stdout.txt"*(">"not in(c:=m.content[len(m.content.split()[0])+1:]))]
 _+=[(c.lower()=='time'and('<'not in c))*" < B:\\bin\\enter.txt"or " < B:\\bin\\yes.txt"*("<"not in c)]
 _=(_[0]+_[1])*(not(m.content.startswith("cd")or m.content[1]==':'))
 try:e=(d:=c.startswith('cd ')*c.lstrip('cd').lstrip()or(c[-1]==":")*(len(c)==2)*(c+'\\'))and[os.chdir(d or os.getcwd()),f"Exit code:{os.system(c+_)}"][1]
 except Exception as r:e=f"Error: {r}";msg=[await m.channel.send(str(e)or "0")];return
 n=(t:=__import__('time').time)();
 while(_:='B:\\Temp\\stdout.txt'))in os.listdir()or(t()<n+500 or os.system("ERASE "+_)):
  with open(_,'rb+')as s:r=s.read().decode()or await asyncio.sleep(1)
 msg+=[await m.channel.send('`'*3+'nim\n'+_+'\n'+'`'*3)for _ in str(r)[0::1980]]
#

there how make golf?

snow beacon
#

You can change indentation to a single space per level.

#

Also shorten names, of course.

floral meteor
#

I'll just make a whole variable manager lol

snow beacon
#

And you don't need the inner brackets in send((...)...(...)) on the last line.

earnest wing
#

__call__ is a bit odd to use in golf

floral meteor
#

okay i've modified it, I'll now make a 'print version`

floral meteor
#

bruuh

#

bruhhhh

night quarryBOT
#

Hey @floral meteor!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

• If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

• If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

floral meteor
#

bruuuuuhhhhh

#

it's obv not golfed enough then

night quarryBOT
#

@floral meteor :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 18
002 | SyntaxError: 'await' outside async function
floral meteor
#

aw

#

i thought the Cursed Coroutine would fix that

#

it done it before

floral meteor
#

!e ```py
msg=[];P=print
class C:new=lambda c,:;await=lambda s:P("awaited",s.d)or s.d
class Os:
def init(s):s.s=True
system=lambda s,f:P('executing',f)and int(f=="NOT A COMMAND");chdir=lambda s,f:P('manipulating directory:',f);getcwd=lambda s:"B:\";listdir=lambda s:["B:\bin\stdout.txt"s._s]
def remove(s,d):P('manipulating file:',d);s._s=s._s
(not d==s.listdir()[0])
class asyncio:sleep=lambda s,t:print('awaited waiting',t,'seconds');await=lambda s:s
class open:
def init(s,args,**kwargs):P("opening: ",args,kwargs);s.p=args[0];s.f=args[1]
def read(s,n=99):return("executed successfully"
(s.f in["r","r+","a+"])or b'executed successfully'
(s.f in["w+","rb","rb+","ab+","wb+"]))[:n]or None
def write(s,c):return len(c)(s.f[0]in['w','a']or s.f[-1]=='+')or None
close=lambda s:P("closed",s.p)
def psc(m):
global msg;os=Os()
_=[" > B:\Temp\stdout.txt"
(">"not in(c:=m.content[len(m.content.split()[0])+1:])),(c.lower()=='time'and('<'not in c))" < B:\bin\enter.txt"or " < B:\bin\yes.txt"("<"not in c)]
=([0]+
[1])(not(m.content.startswith("cd")or m.content[1]==':'))
try:e=(d:=c.startswith('cd ')c.lstrip('cd').lstrip()or(c[-1]==":")(len(c)==2)
(c+'\'))and[os.chdir(d or os.getcwd()),f"Exit code:{os.system(c+)}"][1]
except Exception as r:e=f"Error: {r}";msg=[m.channel.send(str(e)or "0")];return
n=(t:=import('time').time)();
while(
:='B:\Temp\stdout.txt')in os.listdir()or(t()<n+1 or os.remove()):s=open(,'rb+');r=s.read().decode()and os.remove()or asyncio.sleep(1,1);s.close()
msg+=[m.channel.send(''*3+'nim\n'+_+'\n'+''*3)for _ in str(r)[0::1980]]
class M:
def init(s,
,c=None):s.content=;s.channel=c or type("ChannelType",(),{'send':(lambda s,f:P('awaited sending',f)or M(f,c))})
[psc(M(
))for _ in["echo 4","cd here","time < B:\bin\yes.txt","type B:\bin\enter.txt>enter.txt","NOT A COMMAND"]];print(*msg,sep='\n')

night quarryBOT
#

@floral meteor :x: Your eval job timed out or ran out of memory.

001 | opening:  B:\Temp\stdout.txt rb+ {}
002 | manipulating file: B:\Temp\stdout.txt
003 | awaited waiting 1 seconds
004 | closed B:\Temp\stdout.txt
005 | opening:  B:\Temp\stdout.txt rb+ {}
006 | manipulating file: B:\Temp\stdout.txt
007 | awaited waiting 1 seconds
008 | closed B:\Temp\stdout.txt
009 | opening:  B:\Temp\stdout.txt rb+ {}
010 | manipulating file: B:\Temp\stdout.txt
011 | awaited waiting 1 seconds
... (truncated - too many lines)

Full output: too long to upload

cedar hare
#

guys can u please help me in writing a variable and name it something with the help of python bot?
can anyone plssss help me out!

snow beacon
#

Try one of the help channels.

timid imp
#

lol

#

!e

from ctypes import c_void_p
class NoMore:
    def __str__(self):
         return "baby don't hurt me"
        __repr__ = __str__
c_void_p.from_address(id(True)+8).value = id(NoMore)
what = love = object()
what is love
night quarryBOT
#

@timid imp :x: Your eval job has completed with return code 1.

001 |   File "<string>", line 5
002 |     __repr__ = __str__
003 |                       ^
004 | IndentationError: unindent does not match any outer indentation level
timid imp
#

!e

from ctypes import c_void_p
class NoMore:
    def __str__(self):
         return "baby don't hurt me"
         __repr__ = __str__
c_void_p.from_address(id(True)+8).value = id(NoMore)
what = love = object()
what is love
night quarryBOT
#

@timid imp :warning: Your eval job has completed with return code 0.

[No output]
timid imp
#

!e

from ctypes import c_void_p
class NoMore:
    def __str__(self):
         return "baby don't hurt me"
         __repr__ = __str__
c_void_p.from_address(id(True)+8).value = id(NoMore)
what = love = object()
print(what is love)
night quarryBOT
#

@timid imp :white_check_mark: Your eval job has completed with return code 0.

baby don't hurt me
timid imp
#

!e

_while = lambda f,c:[*iter(f,type('',(),{'__eq__':lambda *a:not c()})())]and None

x = []

_while(lambda:x.append(len(x))or print(x), lambda:len(x) < 10)
night quarryBOT
#

@timid imp :white_check_mark: Your eval job has completed with return code 0.

001 | [0]
002 | [0, 1]
003 | [0, 1, 2]
004 | [0, 1, 2, 3]
005 | [0, 1, 2, 3, 4]
006 | [0, 1, 2, 3, 4, 5]
007 | [0, 1, 2, 3, 4, 5, 6]
008 | [0, 1, 2, 3, 4, 5, 6, 7]
009 | [0, 1, 2, 3, 4, 5, 6, 7, 8]
010 | [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
formal sandal
#

Welcome to literal madness!

class _Operator:
    def __init__(self, fn):
        self.fn = fn

    def __truediv__(self, arg):
        return self.fn(arg)

def op(name, method_name):
    class Op:
        def __truediv__(self, _name):
            if _name == name:
                return _Operator(getattr(self, method_name))
            else:
                return super().__truediv__(_name)
    Op.__name__ = Op.__qualname__ = f"op({name!r}, {method_name!r})"
    return Op

class Maybe(op(">>", "shift"), op(">>=", "then"), op("<*>", "ap")):
    def __init__(self, value):
        self.value = value

    def shift(self, other):
        return self /">>="/ (lambda _: other)

    def then(self, fn):
        if self is Nothing:
            return Nothing
        else:
            return fn(self.value)

    def ap(self, arg):
        if self is Nothing:
            return Nothing
        elif arg is Nothing:
            return Nothing
        else:
            return Just(self.value(arg.value))

    def __repr__(self):
        if self is Nothing:
            return "Nothing"
        else:
            return f"Just({self.value!r})"

Nothing = Maybe(object())
Just = Maybe
#

This is the most important line:

class Maybe(op(">>", "shift"), op(">>=", "then"), op("<*>", "ap")):
#

You inherit from classes that create "infix aliases" for methods

#

if you need a different one, I guess you could pick a different operator

thin trout
#

Get

#

Out

#

Now

twilit grotto
#

!ban @formal sandal "bad"

formal sandal
#
class Functor(op("<$>", "fmap")):
    def map(self, f):
        raise NotImplementedError(self)

class Monad(Functor, op(">>=", "then"), op(">>", "shift")):
    def pure(self, x):
        raise NotImplementedError(self)

    def then(self, f):
        return self.map(f).join()

    def join(self):
        raise NotImplementedError(self)

    def shift(self, other):
        return self.then(lambda _: other)

class List(Monad):
    def __init__(self, xs):
        self.xs = xs

    def pure(self, x):
        return List([x])

    def map(self, f):
        return List([f(x) for x in self.xs])

    def join(self):
        rv = []
        for x in self.xs:
            rv.extend(x.xs)
        return List(rv)

    def __repr__(self):
        return f"List({self.xs!r})"

sick hound
#

wtf

#

Insane

sudden willow
#

!e

_=[]
try: print(_[420])
except IndexError as e: print(e[0])
night quarryBOT
#

@sudden willow :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 2, in <module>
003 | IndexError: list index out of range
004 | 
005 | During handling of the above exception, another exception occurred:
006 | 
007 | Traceback (most recent call last):
008 |   File "<string>", line 3, in <module>
009 | TypeError: 'IndexError' object is not subscriptable
sudden willow
#

aww

proper vault
#

huh, neat

formal sandal
#

this is probably the first time I used multiple inheritance outside of Generic and Protocol

elfin onyx
#

oh that's the first time I am seeing __qualname__ being used, i thought it was uselss

floral meteor
#

I've made a sort of pop the contents of a file thing

lambda n:(f:=open(n,'r')).read()and[f.seek(0),f.read(),f.close(),open(n,'w').close()][1]

how make smol?

floral meteor
# sudden willow This is esoteric python

Exactly, so from here, you'd expect an answer to a question like that to be something like:
"""

_=[]==[];__="%c";___={'_':_,'__':__}

And that's all the variables you'll need.
"""

floral meteor
#

I'm thinking this might be more suitable to here than the above channel:

switch={'input':{}}
async def input(p,m,f,*args,**k):
    """
    :param p: prompt
    :param m: message object
    :param f: function to execute on input
    :param args: args for f
    :param k: kwargs
    :return: message object
    """
    global switch;msg=await m.channel.send(p)
    switch['input'].update({'message':m,'target':f,'args':args,'kwargs':k})
    return msg[0]
@client.event
async def on_message(message):
    global msg,switch;msg=switch['input']and[message.channel,message.author]==[switch['input']['message'].channel,switch['input']['message'].author]and[await send(message.channel(switch['input']['f'](*switch['input']['args'],**switch['input']['k']))),switch.update({'input':{}})][0]or msg
    if message.content.lower()=='echo':input("what to echo>",message,lambda s:s,message.content)
snow beacon
#

!e

string = "print('hello world')"
for i in range(15):
    string = f"eval({ascii(string)})"
eval(string)
night quarryBOT
#

@snow beacon :white_check_mark: Your eval job has completed with return code 0.

hello world
sick hound
#

!e

na = "'eval('')'"
nae = f"'eval({na})'"
ni = f"eval({nae})"
print(ni) 
night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

eval('eval('eval('')')')
sick hound
#

!e

na = "'eval('print('Monke Think')')'"
nae = f"'eval({na})'"
ni = f"eval({nae})"
eval(ni)
night quarryBOT
#

@sick hound :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 4, in <module>
003 |   File "<string>", line 1
004 |     eval('eval('eval('print('Monke Think')')')')
005 |                 ^
006 | SyntaxError: invalid syntax
sick hound
#

Hmm

#

Eval recursion

snow beacon
#

That's why ascii(...) is handy.

#
In [1]: ascii("eval('1')")
Out[1]: '"eval(\'1\')"'
next flame
#

that has nothing to do with ascii?

snow beacon
#
In [1]: ascii("…")
Out[1]: "'\\u2026'"
#

It basically escapes any characters in a string.

sick hound
#

!e

(
    (
        lambda __, ___, ____, _____: getattr(
    __builtins__,
    ().__class__.__name__[__ << __]
    + ().__iter__().__class__.__name__[(__).__rmul__(-1)]
    + [].__class__.__name__[____ % ___]
    + chr(_____)
    + ().__class__.__name__[__ >> __],
        )
    )(
        (lambda _: _).__code__.co_nlocals,
        (lambda _, __: _ | __).__code__.co_nlocals,
        (lambda _, __, ___: _ | __ | ___).__code__.co_nlocals,
        (
    (lambda _, __, ___: _ & __ & ___).__code__.co_nlocals.__rmul__(
        (lambda _, __, ___: _ | __ | ___).__code__.co_nlocals
    )
    + (True.__rmul__((lambda _, __: _ | __).__code__.co_nlocals))
        ).__rmul__(
    (
        lambda _, __, ___, ____, _____, ______, _______, ________, _________, __________:
    _
    ).__code__.co_nlocals
        ),
    )
)(
    (
        lambda __, ___, ____, _____, ______: hex.__class__.__name__[
    ___.__rmul__(____ * _____) - ______
        ].upper()
        + hex.__class__.__name__[___.__rmul__(____ * _____) - _____ - ______]
        + hex.__class__.__name__[___] * 2
        + hex.__class__.__name__[___.__rmul__(____ * _____)]
        + chr(__.__rmul__(___) + _____)
        + Warning.__qualname__[______ - True]
        + hex.__class__.__name__[___.__rmul__(____ * _____)]
        + Warning.__qualname__[_____]
        + ().__class__.__name__[___]
        + {}.__class__.__name__[______ - True]
        + chr(__.__rmul__(___) + ___)
    )(
        (
    lambda _, __, ___, ____, _____, ______, _______, ________, _________, __________: (
        _
    )
        ).__code__.co_nlocals,
        (lambda _, __, ___: _).__code__.co_nlocals,
        (lambda _, __, ___, ____: _).__code__.co_nlocals,
        (lambda _, __: _).__code__.co_nlocals,
        (lambda _: _).__code__.co_nlocals,
    )
)   
night quarryBOT
#

@sick hound :white_check_mark: Your eval job has completed with return code 0.

Hello World!
snow beacon
#

You can use #bot-commands to test things out, by the way.

sick hound
#

That it's esoteric

#

Just check it

snow beacon
#

Oh, I thought it was the one I'd seen here a few times.

next flame
#

@snow beacon thats what repr does?

#

f"'eval({na!r})'"

snow beacon
#

ascii is specialised to only operate on strings.

#

Wait, no it isn't.

next flame
#

ascii is literally repr plus some extra escaping

snow beacon
#

As repr(), return a string containing a printable representation of an object, but escape the non-ASCII characters in the string returned by repr() using \x, \u or \U escapes. This generates a string similar to that returned by repr() in Python 2.

sick hound
#

hii

#

guys need help

#

hi

next flame
#

you dont need the extra escaping

#

so just use repr

terse mortar
thick mesa
#

Hi, how can I run a while 1: without reaching an overflow limit - I'm trying to run the code for more than a couple of days, but it always exits with an overflow error

proper vault
#

a while loop doesn't cause that

#

there is something inside it that keeps growing

thick mesa
#

No

#

Post request every while 1:

#

No assigning, only using a logger class outside of the while loop

proper vault
#

what specific error do you get?

thick mesa
#

😄 It's a daily occurrence - I've restarted since, and it clears the log out when you reboot the service

proper vault
#

consider that inside asyncio there is a while loop, and asyncio applications tend to run for months at a time.

#

so while loops are not the problem

thick mesa
#

What's likely to cause an overflow error

proper vault
#

what is the actual name of the error?

#

ah

#

that one generally happens when you get too large a result to stuff into a float

thick mesa
#

This isn't nested inside a method or anything

#

I could wait it out and find the error message

#

And then come back

proper vault
#

that would probably be best

dark loom
#

that's as simple as I can make it

#

!e py print("string"["string"[-"string".__len__()].__len__()] == "string"[-"string".__len__() + "string"[-"string".__len__()].__len__()])

night quarryBOT
#

@dark loom :white_check_mark: Your eval job has completed with return code 0.

True
dark loom
#

I don't know what I'm doing with my life

snow beacon
#

print("string".__bool__())?

sick hound
#

that will output True

snow beacon
#

What was the goal?

toxic jewel
#

wait so i can do

#

!e
print("string".__bool__().__int__())

night quarryBOT
#

@toxic jewel :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: 'str' object has no attribute '__bool__'
toxic jewel
#

sad

thin trout
#

!e

print(str.__bool__("string").__int__())```
night quarryBOT
#

@thin trout :x: Your eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "<string>", line 1, in <module>
003 | AttributeError: type object 'str' has no attribute '__bool__'
thin trout
#

Hmm

#

Oh, it is done through len()

#

Gotcha

long plaza
#

Hello Anybody here?

#

I'd like to ask if python and javascript work in a similar way when it comes to garbage collection.

#

Python has the gc module. It is not exactly same as javascript, then.

naive roost
#

The gc modules allows high-level Python code to change the behaviour of the garbage collector

#

From what I could gather, the garbage collectors of Javascript and Python behave roughly in the same way, removing objects that are not reachable (except what has been initialised at the start of the interpreter, maybe)

edgy kelp
#

mind that gc only interfaces with the gc that handles reference cycles, ref counting and deletion from that will still occur

naive roost
#

however, it seems that the javascript garbage collector/memory manager follows references, while the Python garbage collector goes after the memory manager, which manages the reference counting

#

one note of interest: JS garbage collector cannot be turned off, while the Python one can be (through the gc module)

marsh void
#

python, in fact, has two separate garbage collectors

#

main one is reference-counting one, that destroys objects when their reference count reaches 0 ⇒ they are not referenced by anyone

#

problem with this is that it can not detect cyclic references (e.g. A → B and B → A), which leads to the issue that both A and B will not have their reference counts reach zero, meaning they can't be collected

#

to account for this problem, python has another garbage collecting technique

#

the one that is tracing references and looking for when nothing is referring to an object or collection of objects that reference each other only

#

and the latter garbage collection is the one you can turn off by calling gc.disable()

fiery hare
#

@elfin onyx let's see

elfin onyx
#

!e

for _ in type("", (object,), {"__iter__": lambda self: self, "__next__": lambda self: "Arbitrary object!"})(): ...
night quarryBOT
#

@elfin onyx :warning: Your eval job timed out or ran out of memory.

[No output]
elfin onyx
#

lol, @tribal moon made this

fiery hare
#

what

#

I was going to do that

#

how did you

#

oh

#

yeah I was going to make the class using a call to type

elfin onyx
#

I think you can create a class another way as well, 🤔

tribal moon
#

how

elfin onyx
#

idk

fiery hare
#

this is what guido does when he sees this channel

terse mortar
#

Lol

tribal moon
#

I'd feel bad for him

terse mortar
#

Is he in this discord?

tribal moon
#

probably, just anonymous

elfin onyx
#

But i didn't know you could make an infite loop using itertools

fiery hare
#

I can neither confirm nor deny....

terse mortar
#

If so, look what you've done

elfin onyx
#

that was cool

tribal moon
#

I was told he was in this server but he wanted to be anonymous

terse mortar
#

I meant that makes sense

fiery hare
terse mortar
#

Imagine the amount of pings he would get

fiery hare
#

he only logs in if there's a reason he needs to, from what I understand

fiery hare
terse mortar
#

!otn a guido's-bearded-alter-ego

fiery hare
#

I'll think about that one

#

we already have lemon aka guido

terse mortar
#

Yeah it's too long

fiery hare
#

I mean that hasn't stopped us

#

!otn s object

night quarryBOT
#
Query results

• an-object-is-an-instance-of-a-class

terse mortar
#

It doesn't flow off the tongue but

fiery hare
#

idk why but I'm really proud of that one

#

people love to throw around "oh yeah objects are an instance of a class"

#

that's a meaningless statement unless you already know what it means.

terse mortar
elfin onyx
#

uh guys ot?

#

!Ot

fiery hare
# elfin onyx uh guys ot?

one day that channel is going to be named something you hate and it's going to look like you like that thing

night quarryBOT
fiery hare
elfin onyx
terse mortar
#

Lol

fiery hare
#

!e

from random import choice; import string; print(''.join(chr(ord((z := ' ' + string.ascii_lowercase + '.,')[z.index(i)-2]) - choice([0, 32])) for i in 'knnbujqyb.qwbyjqubqpbvqrke'))
night quarryBOT
#

@fiery hare :white_check_mark: Your eval job has completed with return code 0.

ILl sHOW YOu�wHOS on�TopIC
terse mortar
#

Dude why

#

I love it and hate it so much

fiery hare
#

!e

from random import choice; import string; print(''.join(chr(ord((z := ' ' + string.ascii_lowercase + '.,')[z.index(i)-2]) - choice([0, 32])) for i in 'yjqbuckfbvjgtgbjcubvqbdgbcbtgcuqp'))
night quarryBOT
#

@fiery hare :white_check_mark: Your eval job has completed with return code 0.

wHo saID tHEre haS To�be�A�reasoN
terse mortar
#

I don't know how you understand that

tribal moon
#

lol

terse mortar
#

It looks the same to me

fiery hare
#

the string that it's decoding is different

tribal moon
#

yeah a while back I made a python code obfuscator

#

it's really bad though

#

but it looks horrible

fiery hare
terse mortar
#

Well, what, do you want it to look pretty or something?

tribal moon
#

It can expand a 10 or 15 line program into like 10000

#

it's horribly inefficient and I might try to make it better in the future

#

dunno if I will though

#

I could give an example of the code it generates if you want

terse mortar
#

All in favor for adding a esoteric folder in @night quarry react with 👍

terse mortar
#

Mudkips already done something like that

#

Just on a much, much smaller scale

tribal moon
#

What string do you wanna obfucscate

#

it can be anything

#

it can even be code to execute

terse mortar
#

Ehh

#

Make the string "Chili is ugly"