Advertisement
gpulover

simple example illustrating command-line parsing w/ Python

May 28th, 2018
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. import argparse
  2.  
  3. # parse command-line arguments
  4. parser = argparse.ArgumentParser(description='Plots output from Laplace solver')
  5. parser.add_argument('filename', action="store", type=str)
  6. args = parser.parse_args()
  7.  
  8. x=numpy.loadtxt(args.filename, ndmin=2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement