Update gen.py

Modified the header of the script, to launch explicitly python3