Question: # Jean Beya # CMIT 1 3 5 0 1 # Final Project #Docstring explaining the purpose of the program This script

# Jean Beya
# CMIT 13501
# Final Project
#Docstring explaining the purpose of the program
"""This script creates a new Windows user using Python.
It will prompt the user for a username and password
and create the user with the input information"""
# import the modules
# getpass is a module that allow the user to enter a password in command line
import getpass
#subprocess is a module used to run new codes and applications by creating new processes
import subprocess
#os is a module for creating and removing directories
import os
#system is a module needed before running any functions
import sys
#asking they user if they would like to add a new user
request =input(str("Would you like to create a new user? yes or no "))
#while statement for if the answer is yes or no
while request == 'yes' :
#asking the user to input the new users username
username = input("please enter a new users' Username: ")
#asking the user to input the new users password
password = getpass.getpass()
#use the subprocess module to add the new user
subprocess.run(['net','user',username,password,'/add'])
#print statement that the user has been created
print('A new user has been created with Username',username)
#asking the user if they would like to add a new user
request = input(str("Would you like to create a new user? yes or no "))
#gives output that we are done with creating users
print('We are all done creating users for today. Have a great day!')
#putting my name in the code
print('Jean Beya has enjoyed our time together today'): i nedd fixing so that this script works in both macbook and windoes PCs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!