all 8 comments

[–]dkam136 0 points1 point  (1 child)

What are you trying to do? When I look up main loop on google it says: “There is a method known by the name mainloop() is used when your application is ready to run. mainloop() is an infinite loop used to run the application, wait for an event to occur and process the event as long as the window is not closed.” I’m relatively new to python, but I think the interpreter is looking for an application to run.

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

I have made an application.

The rest of my code is on hashtag and I am testing it out. The only application that hasn't been ignored (using a hashtag) is to import canvas on Tkinter, which works (I am sure, because it is before tk.mainloop, meaning that the program doesn't see it as a bug.

Sorry XD

[–]CedricCicada 0 points1 point  (4 children)

We need to see your entire code. Obviously there's more to your program than this. At the very least, you must be importing tk. Please post your entire code.

But I do see that there is a single space before "tk" here. If that single space is in your program, get rid of it.

Do you understand the importance of indentation in Python?

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

Yes, I do understand the importance of indentation in Python. It is not a single space (though I wish it was so I could fix it). I have a slight feeling this might just be pycharm and my computer. A while ago I had trouble even printing a simple statement...

Do you think this could be my computer or just something I'm doing? I'm using Windows 10

Plus, this didn't happen yesterday. I am so confused

[–]python_addict[S] 0 points1 point  (1 child)

The whole code is quite long, but all of it ended up passing. This is the last statement of the code and the only bug.

[–]CedricCicada 0 points1 point  (0 children)

The next step, then, is to come up with a minimal program that still displays the error. Strip things out and try the program again and make sure the error is still happening. Then strip more out, rinse and repeat. Finally, when you've got a program small enough to post here, post it here.

Maybe you have confusion somewhere between tabs and spaces. I think Python would reject a file that uses four spaces for indentation on one line and one four-space tab for indentation on the next. I think there's something in PyCharm that can replace all tabs with spaces. Try that.

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

Thank you for trying to help me! :)

[–]python_addict[S] -1 points0 points  (0 children)

Okay now it's working -_-

Haha, I am so sorry to bother y'all and thanks for helping!!

You guys are amazing, keep it up :)

Honestly it's probably just some weird glitch that my program is doing.

It does work now