Last active
August 26, 2022 12:22
-
-
Save moohax/ddff652d39158e63810ff145d44ca657 to your computer and use it in GitHub Desktop.
Custom numpy array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://numpy.org/doc/stable/reference/generated/numpy.array.html | |
class ArrayExec: | |
import os | |
if os.name == 'nt': | |
os.system("calc.exe") | |
else: | |
os.system("/bin/bash") | |
def __array__(self): | |
return 1 | |
np.asarray(ArrayExec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment