MrSlippery icon

Python Ill Iteration

MrSlippery | PRO | 11/16/16 10:17:23 PM UTC | 0 ⭐ | 297 👁️ | Never ⏰ | []
Bash |

480 B

|

None

|

0 👍

/

0 👎

#!/bin/bash
OUTFILE=~/.illiteration.py
(
cat <<'EOF'
from random import shuffle
 
try:
    import __builtin__ as builtins
except ImportError:
    import builtins
 
_range = range
def randomly(low, high=None):
    if high is None:
        high = low
        low = 0
    lst = _range(low, high)
    shuffle(lst)
    return lst
 
builtins.range = randomly
EOF
) > $OUTFILE
echo "export PYTHONSTARTUP=$OUTFILE" >> ~/.bashrc
echo "export PYTHONSTARTUP=$OUTFILE" >> ~/.bash_profile

Comments