Write a python script called passmerger that merge contents

Assignment Help Python Programming
Reference no: EM131322730

Programming Problem

Write a Python script called passmerger that will merge the contents of two simplified user account tables in a database as described below. The script uses one command line argument that represents the name of the database file. This name should he validated.

The simple account database contains two tables of accounts. Each entry in these tables has three fields (all text strings) - the username, the encrypted password, and a home directory location like this:

eggert kljsdfjkl /home/eggert

All regular account home directories are in the /home directory based on the account name as given above. Special system account names begin with the word system and have a home directory value of None.

Create a third table in the database with similar fields that represents the merger of the data from the other two tables according to the following rules.

• a system account in the first table should have its entry included just as it is, no changes.
• a system account in the second table should not be included in the merged table.
• an account in either table that is not listed in the other table should have its entry included just as it is, no changes.
• an account that is listed in both tables should have two entries. For the first, the account name should be changed to append _1 to the name in the first field, the password should stay the same, and the home directory location should have a 1_ inserted before the name. For the second entry, the account name should be changed to append _2 to the name in the first field, the password should stay the same, and the home directory location should have a 2_ inserted before the name.

Below is an example showing how these rules apply.

Table 1 accounts:
fred ksdfjsl /home/fred
systeml abc None
wilma skai9e /home/wilma

Table 2 accounts:
barney mmaam /home/barney
wilma oiwehh /home/Wilma
system2 abc None

Merged table accounts:
fred ksdfjsl /home/fred
systeml abc None

wilma _l skai9e /home/1_wilma
wilma_2 oiwehh /home/2_wilma
barney mmaam /home/barney

The modified database should be saved back to the disk before the program ends.

Reference no: EM131322730

Questions Cloud

Employ to encourage the parents or caregivers : Taking into account the parents' and caregivers' potential sensitivities, list at least three specific questions you would ask about the child to gather more information. Provide at least two strategies you could employ to encourage the parents or..
Does entitlement appear to mediate effects of narcissism : After entitlement was entered in Step 1 of the regression equation, entitlement accounted for 3% of the variance in rage when it was entered in Step 2. Does entitlement appear to mediate the effects of narcissism on rage?
What is the intrinsic value of the common shares today : A company pays a $0.50 dividend. The dividend is expected to grow at a 20% rate for the next two years. Thereafter, over the subsequent three years, its growth should decline linearly, ultimately reaching a stable, mature growth rate of 5% per year. ..
Crate and barrel facilitate consumer purchases : How does Crate and Barrel facilitate consumer purchases with its multichannel strategy?
Write a python script called passmerger that merge contents : CSCI 3351: Write a Python script called passmerger that will merge the contents of two simplified user account tables in a database as described below. The script uses one command line argument that represents the name of the database file.
Challenges do consultancy firms face : What special challenges do consultancy firms face that firms operating all items in-house do not?
Preventing workplace discrimination simulation : Resource: Preventing Workplace Discrimination Simulation Complete the Preventing Workplace Discrimination Simulation Write a 350- to 700-word summary that addresses the following:
In given cross lagged panel design does x appear to cause y : In the given cross-lagged panel design, does X appear to cause Y, does Y appear to cause X, do both variables influence each other, or are X and Y unrelated?
What is the yield to maturity-what is the price of the bond : What is the price of a $1,000 face value bond with ten years to maturity if investors require a 7% return and the bond has a coupon rate of 10%? What is the yield to maturity (total yield) on a $1,000 bond selling for 113.42 if the bond has a coupon ..

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd