I was wondering How I can get my code in a window instead of CMD When I run it outside of IDLE. I am using this code with a menu, which uses tkinter. Thanks in Advance. Also If You know how to shorten this code, Please Let me Know. Thanks!
def Castle ():
import random
repeat = "True"
RSN = random.randint(1, 6);
while (repeat == "True"):
print("\nCastle:")
print("\nThe Random Season Chosen is Season", RSN)
if RSN == 1:
print("and The Random Episode Chosen is Episode", random.randint(1, 10))
elif RSN == 2:
print("and The Random Episode Chosen is Episode", random.randint(1, 24))
elif RSN == 3:
print("and The Random Episode Chosen is Episode", random.randint(1, 24))
elif RSN == 4:
print("and The Random Episode Chosen is Episode", random.randint(1, 23))
elif RSN == 5:
print("and The Random Episode Chosen is Episode", random.randint(1, 24))
elif RSN == 6:
print("and The Random Episode Chosen is Episode", random.randint(1, 23))
RSN = random.randint(1, 6);
repeat = input ("\nDo You Want To Run Again?: ")
Castle ();
No = print ("\nPress Enter To Exit")
This site isn't really for people to write complete programs for someone, but since you're learning, and apparently have a teacher that is also learning, I'll show you a complete working example.
Note: this is not the best way to write the program. It's not even the way I would write the program because I would take a more object-oriented approach. What I tried to do was write the simplest program possible.