Comment faire un terminal python

import subprocess
import platform
import socket
import time
import os
import webbrowser
 


path = "C:/"
host_name = socket.gethostname()
host_ip = socket.gethostbyname(host_name)
print("py terminal [Version 1.0 BETA]")
while True:
    code = input(">>>")
    if code == "ping":
        host = input("Enter website to ping:")
        num = input("how many times to ping:")
        
        
        def ping(host):
            param = '-n'  if platform.system().lower() == 'windows' else '-c'
            command = ['ping', param, num, host]
            return subprocess.call(command)
        print(ping(host))
SURAADHYAKSHA SAI