By default use ALT+p for previous command, you can change to Up-Arrow instead in IDLE GUi >> OPtions >> Configure IDLE >>Key >>Custom Key Binding
It is not necesary to run a custom script, besides readlines module doesnt run in Windows.
Hope That Help. :)