Question: # Jean Beya # CMIT 1 3 5 0 1 # Final Project #Docstring explaining the purpose of the program This script
# Jean Beya
# CMIT
# 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 inputstrWould 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 inputplease 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.runnet'user',username,password,add
#print statement that the user has been created
printA new user has been created with Username',username
#asking the user if they would like to add a new user
request inputstrWould you like to create a new user? yes or no
#gives output that we are done with creating users
printWe are all done creating users for today. Have a great day!
#putting my name in the code
printJean 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
