#! /usr/bin/env python
#filename:pwd.py
# development environment:python2.51
import getpass
usr=getpass.getuser()
while True:
pwd=getpass.getpass("passwd:%s:" % usr)
if pwd=='123':
print "welcome to python!!!!"
break
else:
print "The password you entered is incorrect"
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.