[Tutor] File-Fetcher (cmdline-parser)

Christopher Emery cpe.list at gmail.com
Fri Mar 15 17:51:23 CET 2013


Hello All,

OS = Raspbain Wheezy & Ubuntu 12.10 (both updated daily)

Python Version = 3.2 & 3.3
Python Understanding = Beginner (very basic - just started)

See paste bin for code, has 44 lines, code does not give any errors.
http://pastebin.com/2tLHvUym

Okay, I am writing to ask a few question and provide what I have done already.

When using argparse.argument is it wise to use dest="" even if you
don't mind having it set automatic to the arg option such as -u will
become u="None" if it no arg is passed?

Because there are options that can be added to each .add_argument such
as help=, action= is it a good idea to set each one of them even if
the default behavior is what you want?  I thinking future proofing
wise.

In my formatting of my function which will be one of many, am I laying
the code out in a way that will become a good habit or should I do it
different? If so how?

Based on my comments within the function am I understanding what is going on?

At the end I use a print() to see if all is being passed or not being
passed through the cmdline, my question for you is if I want to access
the varibles that are passed through the return args, do I just take
the function like this:
outside_of_functions_var = cmdline_parser()
Does this make outside_of_functions_var a dict or list or other?

Thank you for your assistance and insight into learning. Also if I can
format my emails to the list in a different way that would make it
easier for those to help please do inform me too.

Sincerely in Christ,
Christopher


More information about the Tutor mailing list