11.07.2015 Views

DDM 8.0 Advanced Student Guide

DDM 8.0 Advanced Student Guide

DDM 8.0 Advanced Student Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

options-i: Inspect interactively after running script; force prompts even if stdin is not aterminal. -S: Do not imply import site on initialization -Dprop=[value]: Set thejython property prop to value.-jar jarthe program to run is read from the __run__.py file in the specified jar fileHP CONFIDENTIAL - ENABLEMENT ONLY, NOT FOR CUSTOMER USE.-ccmdargs--help--versionprogram to run is passed in as the cmd string. This option terminates the optionslist file run file as the program script fileprogram is read from standard-in (default; interactive mode is used if on a tty). Thisflag allows you to pipe a file into Jython and have it be treated correctly. Forexample:filter file | jython -arguments passed to the program in sys.argv[1:]print a usage message and exitprint Jython version number and exitSample jython program that uses regular expressionsimport rename = "barry feigenbaum "print name# do a fancy string matchif re.search("^\s*barry\s+feigenbaum\s*$", name): print "It's Barry alright"# replace the first name with an initialname2 = re.sub(r"(B|b)arry", "B.", name)print name2HP Global Enablement© Copyright 2009 Hewlett-Packard Development Company, L.P. 24

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!