Guest User

Untitled

a guest
Jul 2nd, 2018
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.12 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. from colorama import Fore, Back, Style, init
  3. import os, random
  4. randHlaska = ["Kampaň", "Kalúsek", "Sorry jako"]
  5.  
  6. init()
  7.  
  8. while True:
  9.     print(Fore.BLUE + "[py@thon ", end='', flush=True)
  10.     print(Fore.YELLOW + "~", end='', flush=True)
  11.     print(Fore.BLUE + "]", end='', flush=True)
  12.     print(Fore.WHITE + "$ ", end='', flush=True)
  13.     com=input()
  14.     co=com.split(' ')
  15.     if (com[len(com) - 1] != ":"):
  16.         if (com == "ls"):
  17.             dirs = next(os.walk('.'))[1]
  18.             files = next(os.walk('.'))[2]
  19.             for a in dirs:
  20.                 print(Fore.BLUE + a)
  21.             for a in files:
  22.                 print(Fore.WHITE + a)
  23.         elif (com == "exit"):
  24.             exit(0)
  25.         elif (com == "pwd"):
  26.             print(os.getcwd())
  27.         elif (com.startswith("cd")):
  28.             os.chdir(co[1])
  29.         else:
  30.             try:
  31.                 exec(com)
  32.             except:
  33.                 os.system(com)
  34.     else:
  35.     r = ""
  36.     while(com != ""):
  37.             r = r + com + "\n"
  38.             com = input()
  39.         exec(r)
  40.     print(randHlaska[random.randint(0,2)])
Add Comment
Please, Sign In to add comment