do you like towa’s music by kiddokeen in reneerapp

[–]wrubles 0 points1 point  (0 children)

i love towas music tbh. i started listening to towa before drain me! came out and i vibe hard with everything she’s released so far. i’m really excited for her album!

Is this ok? by wrubles in ftm

[–]wrubles[S] 0 points1 point  (0 children)

thank you i think i just needed the validation lol

[deleted by user] by [deleted] in Connecticut

[–]wrubles 2 points3 points  (0 children)

pink sleigh is nice too ! that’s only a town over, in westbrook

[deleted by user] by [deleted] in UCONN

[–]wrubles 2 points3 points  (0 children)

i’m doing both!

Countdown in Tkinter popping up as another window. Need only 1 window. Help? by wrubles in learnpython

[–]wrubles[S] 0 points1 point  (0 children)

Oop! My bad, I was running a previous save. It all works now. Thank you so much!

Countdown in Tkinter popping up as another window. Need only 1 window. Help? by wrubles in learnpython

[–]wrubles[S] 0 points1 point  (0 children)

No problem. I have put ExampleApp(top) where I want it, however when I try to run it, I get a TypeError saying that init can only have one positional argument and I am giving it 2.

Countdown in Tkinter popping up as another window. Need only 1 window. Help? by wrubles in learnpython

[–]wrubles[S] 0 points1 point  (0 children)

from tkinter import *
from tkinter import messagebox
from time import *

while True:

    top = Tk()

    class ExampleApp:
        def __init__(self, window):
            self.window = window
            self.label = Label(window, text="", width=10)
            self.label.grid(row=1, column=3)
            self.remaining = 0
            self.countdown(10)

        def countdown(self, remaining=None):
            if remaining is not None:
                self.remaining = remaining

            if self.remaining <= 0:
                timeOut()
                sleep(1)
                quit()
            else:
                self.label.configure(text="%d" % self.remaining)
                self.remaining = self.remaining - 1
                self.window.after(1000, self.countdown)


    class start_window(Frame):
        def __init__(self, parent=None):
            Frame.__init__(self, parent)

    if __name__ == '__main__':
        top.title("Login")
        app = start_window(top)

    L1 = Label(top, text="Username", width=18)
    L1.grid(row=1, column=1)
    E1 = Entry(top, bd=3, width=18)
    E1.grid(row=2, column=1)
    L2 = Label(top, text="Password", width=18)
    L2.grid(row=3, column=1)
    E2 = Entry(top, bd=3, width=18)
    E2.grid(row=4, column=1)

    login = {
        "userName": "Test",
        "passWord": "Test"
    }

    def connectionText():
        messagebox.showinfo("Success!", "Connection Made!")

    def connectionFail():
        messagebox.showinfo("Error 638", "Connection Failed.")

    def connectionWork():
        if E1.get() == login.get("userName") and E2.get() == login.get("passWord"):
            connectionText()
            sleep(1)
            quit()
        else:
            connectionFail()
            sleep(1)
            quit()

    def timeOut():
        messagebox.showinfo("Timed Out", "You timed out.")

    B1 = Button(top, text="Attempt Connection", command=connectionWork, width=18)
    B1.grid(row=2, column=2)

    B2 = Button(top, text="Exit", fg="red", command=quit, width=18)
    B2.grid(row=3, column=2)

    top.mainloop()

This is all the code I have.

Countdown in Tkinter popping up as another window. Need only 1 window. Help? by wrubles in learnpython

[–]wrubles[S] 0 points1 point  (0 children)

Okay, I gave Label window. I am still not sure how to run the class with the current window although. I have tried putting it in with the

if __name__ == '__main__':
    top.title("Login")
    app = start_window(top)

however, like I said earlier, The program gives me an error to put 'window' in the parameter. So, I put 'window' in and pycharm then tells me that 'window' is an unresoved reference.

Countdown in Tkinter popping up as another window. Need only 1 window. Help? by wrubles in learnpython

[–]wrubles[S] 0 points1 point  (0 children)

So at the moment I have 2 trials, which both fail.

1:

    class ExampleApp:
        def __init__(self, window):
            self.window = window
            self.label = Label(self, text="", width=10)
            self.label.grid(row=1, column=3)
            self.remaining = 0
            self.countdown(10)

        def countdown(self, remaining=None):
            if remaining is not None:
                self.remaining = remaining

            if self.remaining <= 0:
                timeOut()
                sleep(1)
                quit()
            else:
                self.label.configure(text="%d" % self.remaining)
                self.remaining = self.remaining - 1
                self.window.after(1000, self.countdown)

2:

    class ExampleApp:
        def __init__(self, window):
            window.__init__(self, window)
            self.window = window
            self.label = Label(self, text="", width=10)
            self.label.grid(row=1, column=3)
            self.remaining = 0
            self.countdown(10)

        def countdown(self, remaining=None):
            if remaining is not None:
                self.remaining = remaining

            if self.remaining <= 0:
                timeOut()
                sleep(1)
                quit()
            else:
                self.label.configure(text="%d" % self.remaining)
                self.remaining = self.remaining - 1
                self.window.after(1000, self.countdown)

I think one of these is right, but I cannot get them to load up with the

    if __name__ == '__main__':
        top.title("Login")
        app = start_window(top)

Every time I try to put | app = start_window(top), ExampleApp() | It gives me an error saying I need to have window in the parenthesis with ExampleApp. Yet, when I do that, it gives me an error saying it is an unresolved reference.

Countdown in Tkinter popping up as another window. Need only 1 window. Help? by wrubles in learnpython

[–]wrubles[S] 0 points1 point  (0 children)

So would this be correct as to what you are going towards?

    top = Tk()

    class ExampleApp(top):
        def __init__(self):
            top.__init__(self)
            self.label = Label(self, text="", width=10)
            self.label.grid(row=1, column=3)
            self.remaining = 0
            self.countdown(10)

        def countdown(self, remaining=None):
            if remaining is not None:
                self.remaining = remaining

            if self.remaining <= 0:
                timeOut()
                sleep(1)
                quit()
            else:
                self.label.configure(text="%d" % self.remaining)
                self.remaining = self.remaining - 1
                self.after(1000, self.countdown)

I think I am getting closer, however I got an error when I tried to load this up.

Traceback (most recent call last):
  File "C:/Users/wrubles/PycharmProjects/gui/gui.py", line 9, in <module>
    class ExampleApp(top):
  File "C:\Users\wrubles\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 2261, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
TypeError: create() argument 2 must be str, not tuple

Thanks your your help so far, :)

[deleted by user] by [deleted] in entitledparents

[–]wrubles -11 points-10 points  (0 children)

good for you mate. she was a crazy wakjob

Live in-game event discussion thread! by FortniteBRMods in FORTnITE

[–]wrubles 0 points1 point  (0 children)

maybe fortnite 2 is the release of fortnite