Problems with Python password checker
<p>I have created a password checker in Python.  Here is the code that I have used:</p>

<pre><code>import easygui as eg

def pword():
    global password
    global lower
    global upper
    global integer
    password = eg.enterbox(msg="Please enter your password")
    length = len(password)
    print(length)
    lower = sum([int(c.islower()) for c in password])
    print(length)
    upper = sum([int(c.isupper()) for c in password])
    print (upper)
    integer = sum([int(c.isdigit()) for c in password])
    print (integer)

def length():
    global password
    if len(password) &lt; 6:
        eg.msgbox(msg="Your password is too short, please try again")
    elif len(password) &gt; 12:
        eg.msgbox(msg="Your password is too long, please try again")

def strength():
    global lower
    global upper
    global integer
    if (lower) &lt; 1:
        eg.msgbox(msg="Please use a mixed case password with lower case    letters")
    elif (upper) &lt; 1:
        eg.msgbox(msg="Please use a mixed case password with UPPER clase letters")
    elif (integer) &lt; 1:
        eg.msgbox(msg="Please try adding a number")
    else:
        eg.msgbox(msg="Strength Assessed - Your password is ok")

while True:
    pword()
    length()
    strength()

answer = eg.choicebox(title="Try again?",msg="Would you like to try again?", choices=("Yes","No"))
if answer !="Yes":
    sys.exit()
</code></pre>

<p>When I go to run the module it just comes up with the following message:</p>

<p>RESTART: C:\Users\PGUSER72\AppData\Local\Programs\Python\Python35-32\python password 8.py </p>

<p>When I restart it just says RESTART - Shell</p>

<p>I fixed your indentation</p>

<p>Your code works, tested on Ubuntu 14.04 LTS</p>

<p><strong>EDIT:</strong></p>

<p>Also tested on Windows 7 32bit python 2.7.12
<a href="http://i.stack.imgur.com/CGoj8.png" rel="nofollow"><img src="http://i.stack.imgur.com/CGoj8.png" alt="enter image description here"></a></p>

<p>Everything works fine. How are you running your script?</p>

python string function file passwords