Example code snippets are not a good way to do this

Why do you only show the core or main parts of example code and not the imports? Every time I add a new line per your tutorial, I get an error trying to run it. I need to add to the import line. This causes more problems as often I do not know what to add.

Currently I am stuck on the toolbar QSize() line that was added. Python is complaining it doesn’t know what that is. This has happened the last 3 times I added something new. No one has mentioned this before? Everyone else knows what to add to their import lines but me? Very frustrating.

Hi @ralphfreshour10559 thanks for the feedback. When I wrote the tutorials up originally, it was one long step-by-step with instructions to add/remove in parts, but it looks like some of these instructions got missed. I also think this wasn’t the best approach, as it’s easy to get lost in the middle. As I’m rewriting them all for the PyQt6/PySide6 update (to add Qt6 code alongside PyQt5/PySide2) I’m also changing this to add more complete code blocks.

That doesn’t help you now of course, so I’ve gone through and added the imports to all the examples on that tutorial. Let me know if anything is still confusing & I’ll make sure to fix it in the update.

Wow that was fast! Thank you very much Martin.

I’m going to purchase your eBook. I’m using PyQt5. Should I buy your PyQt5 or PyQt6 eBook? If I buy the 6 book, will I run into problems getting PyQt5 to work with the examples in it?

I went ahead and purchased the PyQt5 eBook. I read the differences between PyQt6 and PyQt5 and it scared me (don’t laugh)!! I’ll stick to 5 for learning at this stage.

One other comment that I found confusing:

“Load up a fresh copy of MyApp_window.py and save it under a new name for this section.”

I could not find that .py file so I’m not exactly sure how to create that file (what to put in it).