def main(): ADDR = (IP, PORT) sk = socket(AF_INET, SOCK_STREAM) sk.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) sk.connect(ADDR) while True: menu() message = input('请按照菜单格式输入:') if message == 'quit': sk.close() sys.exit(0) else: sk.send(message.encode()) data = sk.recv(1024) print(data.decode()) if data.decode() == 'OK': useapp(ADDR, sk)
#menus #packs #menu from menu.menu import menu menu()
from menu.menu import menu from utils.clear import clear from quit.quit import quiting from credit.credit import credit while 1: action = menu(["play","credit","quit"]) if action == "play": print("play") elif action == "credit": credit() elif action == "quit": quiting() else: print("Sometings goes wrong with the menu :/")
import menu.menu as menu if __name__ == "__main__": menu.menu()