Two Python file are in the same folder and have exactly the same codes, but one works and the other does not

I’m working on PyQt5 QtWidgets for practice purposes in Python. It was working flawlessly in the exercise I did recently. Now, I wanted to open a new Python file in same folder and do a new exercise, but when run in the new Python file, the object does not appear. Then I copied the codes from my old exercise and pasted them into the new file, this time it works. But when I open a new file and want to create a new project, the PyQt5 element does not appear on the screen again.

And exit code is “Process finished with exit code -1”

Now, I wrote the exact codes in the old file, but the old one works, the new one does not. If I copy the old ones to the new one, it works. And they are all in the same folder, the paths look the same, the rules are the same, but I couldn’t find a solution to the problem.


This both of the files side by side, right one is working left one is not.

Is there any idea what’s going on here?

The one on the left has __init__, the one on the right has __int__.

2 Likes

PyCharm may also have been warning about that (it seems to indicate 8 warnings versus only 3 on the left) :joy:

Wow. How can i miss that, pycharm was refilling that, I literally struggled with this all day. It’s ridiculous :smiling_face_with_tear: Thank you <3

lol maybe :joy: But Pycharm warns me all the time :joy:

I cannot tell you how much time I’ve spent debugging these kind of “stupid” little, almost invisible spelling errors… And in this case I also didn’t see it until @MRAB pointed it out!

It’s ALWAYS something little. The question is: Out of the tens of thousands of little problems that it might have been, which one is it this time?!?

1 Like

Reference for __int__:

How to make sure that “identical” source files are actually identical: use a diff tool.

Thank you all again <3