Advertisement
LEO44444

CHATOFF

Nov 12th, 2024
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. from os import system
  2. from colorama import Back, Style, Fore
  3. def main():
  4. global cname
  5. global name
  6. system("clear")
  7. print(Back.GREEN + "OffChat")
  8. print(Style.RESET_ALL+"**************************************")
  9. print(Back.YELLOW + """
  10. Porfavor introduzca su nombre de
  11. usuario y despues presione ENTER""")
  12. print(Style.RESET_ALL+"**************************************")
  13. name = input(Fore.BLACK+Back.WHITE+"Introduzca su nombre de usuario: ")
  14. print(Style.RESET_ALL)
  15. system("clear")
  16. print(Back.GREEN + "OffChat")
  17. print(Style.RESET_ALL+"**************************************")
  18. print(Back.YELLOW + """
  19. Porfavor introduzca el nombre del
  20. chat a el que usted quiere acceder""")
  21. print(Style.RESET_ALL+"**************************************")
  22. cname = input(Fore.BLACK+Back.WHITE+"Introduzca el nombre del chat a el que quiere acceder: ")
  23. print(Style.RESET_ALL)
  24. chat()
  25. def chat():
  26. system("clear")
  27. try:
  28. readchat = open(f"{cname}.actp", "r")
  29. writechat = open(f"{cname}.actp", "a")
  30. chatcontent = readchat.read()
  31. except:
  32. open(f"{cname}.actp", "x")
  33. readchat = open(f"{cname}.actp", "r")
  34. writechat = open(f"{cname}.actp", "a")
  35. chatcontent = readchat.read()
  36. print(Back.GREEN + f"OffChat - {cname}")
  37. print(Style.RESET_ALL+"**************************************")
  38. print(Back.YELLOW + f"""
  39. Chat:
  40. {chatcontent}""")
  41. print(Style.RESET_ALL+"**************************************")
  42. msg = input(Fore.BLACK+Back.WHITE + "Escribe tu mensaje: ")
  43. print(Style.RESET_ALL)
  44. writechat.write(f"\n{name}: {msg}")
  45. writechat.close()
  46. chat()
  47. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement