Script to convert (basic) perl code to python.