Advertisement
afrizalwahyuadi66

UMenu.py

Apr 20th, 2024
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.34 KB | None | 0 0
  1. # Perpustakaan--------------------------------------------------------------------------
  2. import os
  3. from subprocess import call
  4. import shutil
  5. #---------------------------------------------------------------------------------------
  6.  
  7. # Function to print colored text--------------------------------------------------------
  8. def print_color(text, color):
  9.     if color == 'red':
  10.         print("\033[91m" + text + "\033[00m")
  11.     elif color == 'green':
  12.         print("\033[92m" + text + "\033[00m")
  13.     elif color == 'yellow':
  14.         print("\033[93m" + text + "\033[00m")
  15.     elif color == 'blue':
  16.         print("\033[94m" + text + "\033[00m")
  17.     else:
  18.         print(text)
  19. #---------------------------------------------------------------------------------------
  20.  
  21.  
  22. # Define the logo-----------------------------------------------------------------------
  23. logo = (
  24.     "\033[34m  ██╗░░░██╗████████╗░██████╗░░░░░░░█████╗░███╗░░██╗░██████╗███████╗ \n"
  25.     "\033[34m  ██║░░░██║╚══██╔══╝██╔════╝░░░░░░██╔══██╗████╗░██║██╔════╝╚════██║ \n"
  26.     "\033[34m  ██║░░░██║░░░██║░░░╚█████╗░█████╗███████║██╔██╗██║╚█████╗░░░░░██╔╝ \n"
  27.     "\033[34m  ██║░░░██║░░░██║░░░░╚═══██╗╚════╝██╔══██║██║╚████║░╚═══██╗░░░██╔╝░ \n"
  28.     "\033[34m  ██║░░░██║░░░██║░░░░╚═══██╗╚════╝██╔══██║██║╚████║░╚═══██╗░░░██╔╝░ \n"
  29.     "\033[34m  ╚██████╔╝░░░██║░░░██████╔╝░░░░░░██║░░██║██║░╚███║██████╔╝░░██╔╝░░ \n"
  30.     "\033[34m  ░╚═════╝░░░░╚═╝░░░╚═════╝░░░░░░░╚═╝░░╚═╝╚═╝░░╚══╝╚═════╝░░░╚═╝░░░ \n\n"
  31.     "\033               Tugas UTS Algoritma 2\n\n"
  32.                                                                                                                                                                      
  33.     "\033   [91m 1. Afrizal Wahyu Adi Putra\t 11230070\n"
  34.     "\033    2. Nadia Zahira Sofa\t\t 11230056 \n"
  35.     "\033          3. Syifa Susila Pratami\t 11230068 \n"
  36.     "\033[0m"
  37. )
  38. #---------------------------------------------------------------------------------------
  39.  
  40.  
  41. # Clear screen--------------------------------------------------------------------------
  42. os.system('cls' if os.name == 'nt' else 'clear')
  43. #---------------------------------------------------------------------------------------
  44.  
  45.  
  46. # Print the logo------------------------------------------------------------------------
  47. print(logo)
  48. #---------------------------------------------------------------------------------------
  49. def display_menu():
  50.     os.system('cls' if os.name == 'nt' else 'clear')
  51.     print(logo)
  52.    
  53.     print("=== Menu Program ===")
  54.     print("| 1. Program 1     |")
  55.     print("| 2. Program 2     |")
  56.     print("| 3. Program 3     |")
  57.     print("| 4. Program 4     |")
  58.     print("| 5. Program 5     |")
  59.     print("| 6  Program 6     |")
  60.     print("| 7. Program 7     |")
  61.     print("| 8. Program 8     |")
  62.     print("| 9. Program 9     |")
  63.     print("| 10. Program 10   |")
  64.     print("====================")
  65.  
  66. def display_menu1():
  67.     os.system('cls' if os.name == 'nt' else 'clear')
  68.     print(logo)
  69.  
  70. def display_menu2():
  71.     os.system('cls' if os.name == 'nt' else 'clear')
  72.     print(logo)
  73.    
  74.     print("=== Menu Program ===")
  75.     print("| 1. Program 11    |")
  76.     print("| 2. Program 12    |")
  77.     print("| 3. Program 13    |")
  78.     print("| 4. Program 14    |")
  79.     print("| 5. Program 15    |")
  80.     print("| 6  Program 16    |")
  81.     print("| 7. Program 17    |")
  82.     print("| 8. Program 18    |")
  83.     print("| 9. Program 19    |")
  84.     print("| 10. Program 20   |")
  85.     print("====================")
  86.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement