-4

I'm trying too teach myself Python and am currently making a local logon program, it isn't no where near finished yet, and plan to upgrade/improve as I learn new skills. However at the moment I'm getting an unindent error, can someone please explain to me how to fix it? Because Googling didn't give me an answer.

import time
import hashlib
import sys

print("Welcome to SYS Secure Login")
time.sleep(1)
print("Please put ID against the blue wall")
time.sleep(2)
print("\nUser ID detected, continuing sequence")
time.sleep(3)
print("\n\n...Loading...")
time.sleep(2)

name = input('\nEnter username: ');
if name == 'Bradley':
    pwd = input('Enter password: ')
    if pwd == '1234':
                print("\nWelcome," , name, "")
                time.sleep(2)
                command = input("\nEnter Command: "); #only valid commands work, any other commands loop back to this statement

####                                                           upload command                

                if command == ('upload backdoor.jar'):
                    print("\n\n...Loading")
                    time.sleep(2)
                    print("\n\n.backdoor.jar uploading")
                    time.sleep(4)
                    print("\n\n.backdoor.jar upload complete")

####                                                           add user command

                if command == ('add_newuser'): #adds new user to local logon
                    print("\nAdding new user, please insert permision rank ")

                    rank = input('\Rank Permision is: ');
                    if rank == 'guest':
                        print("Guest account created")
                    elif rank == 'admin':
                        print("admin account created")
                    elif print("Unknown paramiters"):

####                                                            unknown command

            **if not command ##ERROR HERE**
            print("\n\nInvalid Command, please try again")

else: #For username, to 'fool' any person with unknown username 
    input("Enter password: ")
    print("\n\nInvalid username or password, program closing")
    exit()



input("\n\nPress the enter key to exit.")
dynastyuk
  • 9
  • 2
  • 1
    You also have some other errors: `**if not command ` is not valid python. It's also helpful if you say what line your error is on when posting a question. – flau Aug 11 '14 at 15:51

2 Answers2

2

You're using 4-spaces indentation, but suddenly you put 8 spaces in the if pwd == '1234': code block. Be consistent.

cdonts
  • 9,304
  • 4
  • 46
  • 72
-1

Hey i solved this issue and it run properly :

import time
import hashlib
import sys

print("Welcome to SYS Secure Login")
time.sleep(1)
print("Please put ID against the blue wall")
time.sleep(2)
print("\nUser ID detected, continuing sequence")
time.sleep(3)
print("\n\n...Loading...")
time.sleep(2)

name = input('\nEnter username: ');
if name == 'Bradley':
    pwd = input('Enter password: ')
    if pwd == '1234':
        print("\nWelcome," , name, "")
        time.sleep(2)
        command = input("\nEnter Command: "); 
        if command == ('upload backdoor.jar'):
            print("\n\n...Loading")
            time.sleep(2)
            print("\n\n.backdoor.jar uploading")
            time.sleep(4)
            print("\n\n.backdoor.jar upload complete")
            if command == ('add_newuser'): #adds new user to local logon
                print("\nAdding new user, please insert permision rank ")
                rank = input('\Rank Permision is: ');
                if rank == 'guest':
                    print("Guest account created")
                elif rank == 'admin':
                    print("admin account created")
                elif print("Unknown paramiters"):
                    print("\n\nInvalid Command, please try again")
else: 
    input("Enter password: ")
    print("\n\nInvalid username or password, program closing")
    exit()
input("\n\nPress the enter key to exit.")

This is because after every condition you have give some extra tab/Space and it happens sometime . To get rid of this type of error use VScode it shows the extra spaces in python code and solve it by showing you the proper error.

Zeeking786
  • 165
  • 1
  • 27