update python code to latest java and write options to file