Friday, 7 June 2013

Prompt for user input in Jython

            
sys.stdout.write("Do you want to replace this certificate YES/NO? : ")
userResp = sys.stdin.readline()

if(re.search("YES", userResp)):
                        genNewCert(keystoreName, scopeName, alias, issuedTo)


And you'll need to chomp the result to get rid of the newline (just in case rstrip() doesn't work as expected). Do this as follows...

tmpIn = sys.stdin.readline()
new_alias = tmpIn.splitlines()[0]

No comments:

Post a Comment