python:examples
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| python:examples [2014/09/16 08:26] – admin | python:examples [2016/08/03 08:53] (current) – removed admin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Python Examples ====== | + | |
| - | ===== Get Parameters from main ===== | + | |
| - | * Create simple code mainparams.py:< | + | |
| - | import sys | + | |
| - | nargs = len(sys.argv) | + | |
| - | outpath = '' | + | |
| - | paramename = ' | + | |
| - | print sys.argv | + | |
| - | if nargs > 1: | + | |
| - | paramename = sys.argv[1] | + | |
| - | print ' | + | |
| - | </ | + | |
| - | * run:< | + | |
| - | mainparams.py hello | + | |
| - | </ | + | |
| - | [' | + | |
| - | paramename = hello | + | |
| - | </ | + | |
python/examples.1410855992.txt.gz · Last modified:  (external edit)
                
                