Monday, October 26, 2009

Run Time arguments

Test.py
import sys
class Test :
  def main(self):
  args = sys.argv
  option = args[1]
  print 'Hello ' + option

edit = Test()
edit.main()

Run the jython file using:
jython Test.py World

The Result would be:
Hello World

No comments:

Post a Comment