I found a static propertie 'input' of File object for stdin. It work better than readline();. I'll pay my effort to complete my script.
CVSTrac 2.0.1