hamtestprep rewrite in python 2.x