Postgresql Ascii Generator Python