Interactive script

Are there way how to do this script(rename 000.txt to 000.py)?
This script use input function ,but this function cant use in PP