You are right, it does not run in Terminal (though I do not yet why - still investigating). In Thonny IDE (on Raspberry Pi 5) it works perfectly. If I do the same in Geany IDE it does not run (it just terminates withvexit code 0; Same as in Terminal).