Python gives the following error:
Traceback (most recent call last):
File "C:\Python34\Google_Map.py", line 246, in <module>
main()
File "C:\Python34\Google_Map.py", line 232, in main
username = args.username
AttributeError: 'Namespace' object has no attribute 'username'enter code here
I guess I must have passed the argument incorrectly. Please refer to the following code snippet below:
def main():
# parse arguments
parser = argparse.ArgumentParser(description='InstaRaider')
parser.add_argument('-styledbyafrica', help='Instagram username')
parser.add_argument('-c:\python34\pikshor images\styledbyafrica', help='Where to save the images')
parser.add_argument('-n', '--num-to-download',
help='Number of posts to download', type=int)
parser.add_argument('-l', '--log-level', help="Log level", default='info')
args = parser.parse_args()
username = args.username
directory = op.expanduser(args.directory)
raider = InstaRaider(username, directory,
num_to_download=args.num_to_download,
log_level=args.log_level)