Python Forum
No again function discovered in python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No again function discovered in python
#1
This is my first semi-professional project in Python. And I'm in trouble.

Python does not understand the again function. This means that when you press button 2, Python executes the second function and after finish it, python do that function agin.

Can anyone help me solve this problem?

This is my code :
import subprocess
#do it again
def again():
    again_v = input('For Menu type (M) for Exit type (E) : ')
    if again_v.upper() == 'M':
        start()
    elif again_v.upper() == 'E':
        print('Good Luck !')
    else:
        again()

    
#create username and password
def creat_user():
    user = input('Enter your Username : ')
    Pass = input('Enter your Password : ')
    userpass = subprocess.check_output('net user {} {} /add' . format(user,Pass) , shell=True)
    adm = subprocess.check_output('net localgroup administrators {} /add' . format(user) , shell=True) #give administrator to user
    print('Done !')  


#change password        
def ch_pass():
    u = input('Ok, Enter your Username : ')
    p = input('Now, Enter your new Password : ')
    u_p = subprocess.check_output('net user {} {}' . format(u,p) , shell=True)
    print('Action completed !')
     


def start():
    a = input('''
Welcome,
[+] (1) Create new user
[+] (2) Change your password

what do you want to do? : ''')
    
    a = int(a)


    if a == 1:
        creat_user()

    elif a == 2:
        ch_pass()
 

    creat_user()
    again()
        

    ch_pass()
    again()

start()
snippsat write Apr-02-2021, 09:57 PM:
Added code tag in your post,look at BBCode on how to use.
Reply


Messages In This Thread
No again function discovered in python - by Noobsfather - Apr-02-2021, 08:16 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020