Search code examples
pythonjythonwlst

How to provide automated user input in wlst


How to provide automated user input in wlst? I am trying expectj, but i am getting few errors while spawning process in java code. The spawned process is a wlst script .py.

Is there any other simpler way to provide user input?


Solution

  • Yes we have other options in Pythonic way, that is input() or raw_input() statement will give you the input option to read wls:/offline> x=raw_input('Enter a number:') or ELSE you can try with command line arguments with getopt

    try:
        opts, args = getopt.getopt( sys.argv[1:], "t:i", ["Timeout","Interval"] )
    except getopt.GetoptError, err:
        print str(err)
    

    Confirm did this worked for you?