If it's a modal dialog, then your code will not continue until the dialog is closed, so you don't have to do anything (i.e. that pseudo-code you provided will do what you want).
However, your users may prefer entering all information on just one window, rather than having many windows pop up in turn. It seems like you are quite new to this, but perhaps in the future you might think about ways to allow ingredients to all be entered in one window. I'd imagine a text box with an "Add" button below that adds another text box for the next ingredient. The window would have to grow or show scroll bars when the number of ingredients gets large.
That stack overflow page also mentions using a modal dialog. As for how to do it in Python, I'm sure PyQt also has a QDialog class with an exec method.




Reply With Quote

Bookmarks