Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from os import system
- from colorama import Back, Style, Fore
- def main():
- global cname
- global name
- system("clear")
- print(Back.GREEN + "MMO (Mensajeria en el Mismo Ordenador)")
- print(Style.RESET_ALL+"**************************************")
- print(Back.YELLOW + """
- Porfavor introduzca su nombre de
- usuario y despues presione ENTER""")
- print(Style.RESET_ALL+"**************************************")
- name = input(Fore.BLACK+Back.WHITE+"Introduzca su nombre de usuario: ")
- print(Style.RESET_ALL)
- system("clear")
- print(Back.GREEN + "MMO (Mensajeria en el Mismo Ordenador)")
- print(Style.RESET_ALL+"**************************************")
- print(Back.YELLOW + """
- Porfavor introduzca el nombre del
- chat a el que usted quiere acceder""")
- print(Style.RESET_ALL+"**************************************")
- cname = input(Fore.BLACK+Back.WHITE+"Introduzca el nombre del chat a el que quiere acceder: ")
- print(Style.RESET_ALL)
- chat()
- def chat():
- system("clear")
- try:
- readchat = open(f"{cname}.txt", "r")
- writechat = open(f"{cname}.txt", "a")
- chatcontent = readchat.read()
- except:
- open(f"{cname}.txt", "x")
- readchat = open(f"{cname}.txt", "r")
- writechat = open(f"{cname}.txt", "a")
- chatcontent = readchat.read()
- print(Back.GREEN + "MMO (Mensajeria en el Mismo Ordenador)")
- print(Style.RESET_ALL+"**************************************")
- print(Back.YELLOW + f"""
- Chat:
- {chatcontent}""")
- print(Style.RESET_ALL+"**************************************")
- msg = input(Fore.BLACK+Back.WHITE + "Escribe tu mensaje: ")
- print(Style.RESET_ALL)
- writechat.write(f"\n{name}: {msg}")
- writechat.close()
- chat()
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement