Last active
June 9, 2023 20:42
-
-
Save skelly37/43747936edba57c907ae2ccd08d93943 to your computer and use it in GitHub Desktop.
Aliases for python in shell (exit, clear, get random number). Usage: `alias python = python3 -i /path/to/python_shell_aliases.py`
This file contains 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
#!/usr/bin/python3 | |
class Clear: | |
def __repr__(self): | |
from os import system | |
system("clear") | |
return "" | |
class Exit: | |
def __repr__(self): | |
exit() | |
class rand: | |
def __init__(self, start, end): | |
self.start = start | |
self.end = end | |
def __repr__(self): | |
from random import randint | |
return str(randint(self.start, self.end)) | |
_ = Clear() | |
e = Exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment