Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- import time
- import threading
- def loading_animation():
- """Displays a loading animation as a progress bar."""
- bar_length = 20 # Length of the progress bar
- for i in range(bar_length + 1):
- time.sleep(0.1) # Simulate loading
- filled_length = int(bar_length * i // bar_length) # Calculate filled length
- bar = '█' * filled_length + '-' * (bar_length - filled_length) # Create the bar
- print(f"\r[{bar}] Loading Software", end="")
- print("\r[████████████████████] Loading complete.")
- def handle_command(command):
- """Handles the commands entered by the user."""
- if command.startswith("/ld"):
- cmd_parts = command.split(" ")
- if len(cmd_parts) == 2:
- project = cmd_parts[1]
- if project == "ping":
- # Start loading animation in a separate thread
- loading_thread = threading.Thread(target=loading_animation)
- loading_thread.start()
- loading_thread.join() # Wait for the loading animation to finish
- print("Launching ping software...")
- os.execv(sys.executable, ['python'] + ['pingsubsoft.py'])
- elif project == "dev":
- # Start loading animation in a separate thread
- loading_thread = threading.Thread(target=loading_animation)
- loading_thread.start()
- loading_thread.join() # Wait for the loading animation to finish
- print("Launching dev software...")
- os.execv(sys.executable, ['python'] + ['devsubsoft.py'])
- else:
- print("Unknown project. Available: ping, dev.")
- else:
- print("Error: Invalid format. Use '/ld project_name'.")
- else:
- print("Unknown command.")
- def main():
- # ASCII art title
- title = r"""
- |__ __| ____| __ \| \/ |_ _| \ | | /\ | |
- | | | |__ | |__) | \ / | | | | \| | / \ | |
- | | | __| | _ /| |\/| | | | | . ` | / /\ \ | |
- | | | |____| | \ \| | | |_| |_| |\ |/ ____ \| |____
- |_|_ |______|_|_ \_\_| |_|_____|_| \_/_/ \_\______|
- | | | | | | | _ \
- | |__| | | | | |_) |
- | __ | | | | _ <
- | | | | |__| | |_) |
- |_| |_|\____/|____/
- A Mac-User's Linux Dream
- Edmund Chenault & GPT 4o """
- print(title) # Now prints the title one line up
- print("\nWelcome to the Terminal Hub!")
- while True:
- command = input("> ")
- if command.lower() in ["/quit", "/exit"]:
- break
- handle_command(command)
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement