#πŸ”’ I want to run the rest of the code without having to close the tk window

7 messages Β· Page 1 of 1 (latest)

quasi salmon
#
print("Wait, we are checking for updates. A window will wildly appears in few seconds...")
time.sleep(4)
window = tk.Tk()
greeting = tk.Label(text="Hello, Joseph?")
greeting.pack()
window.mainloop()

random.seed()

name_list = [
    "apple", "banana", "cherry", "date", "elderberry", "fig",
    "grape", "honeydew", "kiwi", "lemon", "mango", "nectarine",
    "orange", "papaya", "quince", "raspberry", "strawberry", "tangerine",
    "ugly", "vanilla", "watermelon", "xi", "yellow", "zucchini"
]
number_list = ["abacus", "breeze", "candle", "dolphin", "eclipse", "fable",
               "giraffe", "horizon", "igloo", "jungle", "kettle", "lighthouse",
               "mystery", "nucleus", "ocean", "puzzle", "quasar", "robot",
               "sunset", "tornado", "umbrella", "vortex", "whisper", "xylophone",
               "yawn", "zephyr"]

list_users = []


def user_logged(a, b):
    user = input("You have to input two numbers:  ")
    list_users.append(a)
    list_users.append(b)
    print(list_users)
    a = random.randint(1, 24)
    b = random.randint(1, 26)
    print(f"You name and password is {number_list[a]} {name_list[b]}")
    if user == "John Smith":
        print("Welcome")
    else:
        print("I think we both are at wrong places.")


user_logged(1, 3)

def user_files(name, last_name, file_name):
    user_input = input("Did you want to create a file?")
    with open(f"{file_name}.txt", "w") as file:
        for i in range(8):
            file.writable(f" {name}Pie{last_name} -.- {file_name} Blueberry...")
            print(f"{file_name}.txt")


user_files("Joe", "DeeJay", "Mu")

next moatBOT
#

@quasi salmon

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

trim ice
#

You need to use a while loop with the tk.Tk().update() method instead of the tk.Tk().mainloop()

quasi salmon
#

works, thank you

#

!dormant

next moatBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.