Producing variants of a password based on command-line flags
Some remarks about your code:


Use if __name__ == '__main__':
In my opinion argparse is better then the getopt way,
Divide your code into functions for seperation of control
Use string formatting
Uphold PEP8 guidelines for a cleaner code




1.

def main():
    parse_options()
    do_stuff()

if __name__ == '__main__':
    main()




2.
Example of parsing options via argparse

def parse_options():
    parser = argparse.ArgumentParser(usage='%(prog)s [options] &lt;password&gt;',
                                     description='Password-Tool',
                                     formatter_class=argparse.RawDescriptionHelpFormatter,
                                     epilog=
'''
Examples
'''

                                        )
    parser.add_argument('-o', action="store_true", help='output file')
    ...
    args = parser.parse_args()




3.
When dividing code into seperate functions it makes for a more readable code, and that way it can be imported by other programs.



4.
When using print formatting looks better and correct way would be:

print '{} some text here'.format(i)