implementation of command line arg passing in python, doesn't work
<p>I'm very new to python. I wish I could implement the command-line arg passing in python as my first python script. I have written this code:</p>

<pre><code>def main(argv):
    try:
        opts, args = getopt.getopt(argv, "hb:b:f", ["help", "bucket=", "folder"])
    except getopt.GetoptError:
        usage()
        sys.exit(2)
    s3 = get_files()
    for opt, arg in opts:
        if opt in ("-h", "--help"):
            usage()
            sys.exit()
        elif opt in ("-b", "--bucket"):
            s3.bucketname = arg
        elif opt in ("-f", "--folder"):
            s3.foldername = arg
            print("Came here" + s3.foldername)
    s3.download_files()
</code></pre>

<p>In the <code>-f</code> argument from command is where I'm facing the problem. For debugging I used the <code>print</code> statement. I pass the arguments like this:</p>

<pre><code>./hello -b something -f /path
</code></pre>

<p>but sadly it prints out:</p>

<pre><code>Came here
</code></pre>

<p>But the <code>foldername</code> attribute is not getting assigned any value. Where I'm making the mistake?</p>

<p>Thanks in advance.</p>
