Since S&R runs in the GUI thread, as you discovered, you can show any GUI you like in your replace function. However, this is accidental and is not really something S&R was designed for, so dont be surprised if it breaks someday.
And as @eschwartz said, you should use Qt dialog boxes, that way your code will work everywhere, something like
from PyQt5.Qt import QInputDialog
from calibre.gui2.tweak_book.boss import get_boss
ok, answer = QInputDialog.getText(get_boss().gui, ...)
See the documentation for QInputDialog for the details
|