I'm tryting to use one integer as positional argument in argparse. Given is the following complete python script (taken from this tutorial):
#!/usr/bin/env python
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("square", help="display a square of a given number",
type=int)
args = parser.parse_args()
print args.square**2
When I call this script as
> script.py 3
I get as a result
error: argument square: invalid int value: 'C:\\home\\dev\\freqana\\3'
argparse clearly expects a filesystem path here, but why? The type is for sure set to int.