#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    2
    Rep Power
    0

    Please correct me


    hello am new to python and can't see what wrong with the following codes: pls help me. it genrate an error

    # Script to protect members of exclusive site
    # MEMBERS ONLY
    # By Patrick Andoh - 18\06\2013

    print "\tWelcome to the exclusive site:"
    print "\t\tPlease you will need to register to be one:"

    security = 0
    username = ""
    while not username:
    username = raw_input("Username:")

    password = ""
    while not password:
    password = raw_input("Password:")

    if username == "Patrick" and password == "Jet":
    print "Hi, Pat."
    security = 5
    elif username == "james" and password == "secret":
    print "Sup, James?"
    security = 3
    elif username == "Frank" and password == "civilization":
    print "Welcome, Frank"
    security 3
    elif username == "Tiger" and password == "Attack":
    print "Hay, how you doing?"
    security = 3
    elif username == "guest" and password == "guest":
    print "You are a Limited User, Please sign up"
    security = 1
    else:
    print "Login failed, Forgotten your password?"

    raw_input("\n\nPress the enter key to exit.")
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,663
    Rep Power
    1958
    It will be better if you posted it in the proper forum. You posted it in the forum for HTML.

    When you post code, please use code tags ([code ] [ /code])
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    103
    Rep Power
    3
    Are you running this as a cgi script on a Web Server? If so you will need to include a shebang.

    Telling us what error is occurring and when it occurs would be helpful.
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,894
    Rep Power
    481
    Your program needs an = symbol in the problematic line.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo