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

  Project- add time and object interaction to the simulation

Project: Add Time and Object Interaction to the Simulation. Bring the simulation to life with simulated time and object interaction. Illustrates the alternative flow of control for errors provided by try/catch in place of returned error codes

  Aussie best car abcdeclares that based on its yearly sales

aussie best car abcdeclares that based on its yearly sales it will award a bonus as follows. the bonus will be equally

  Write the code to allow user to input three integer numbers

Write the code to allow a user to input three integer numbers. The program will then produce the average of thosethree numbers

  Prepare program that will compute tip and tax on meal price

CS21A Lab 3: Functions- Write a program that will calculate a XXX% tip and a 6% tax on a meal price. Python comes with a standard library of functions. Some of the functions that you have used already are input, type, and range.

  Write a program using the ''requetinteger''

using python/jython programming write a program using the 'requetInteger' function that will ask the user to type a value that will draw a line from one point on a picture to another. I don't need specific help just a gerneral idea.

  Code a console-based program in python

CP1404/CP5632 2016 SP2/22/52 Shopping List 1.0 - You are to plan and then code a console-based program in Python 3, as described in the following information and sample output. This assignment will help you build skills using selection, repetition,..

  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.

  Write program that will calculate a tip and a tax on a meal

Write a program that will calculate a XXX% tip and a 6% tax on a meal price. Each programming assignment should have the following header, with italicized text appropriately replaced.

  Design part of the code for the haunted house game

Create a cheat commands in the game so player can teleport to any location in the map - You are tasked with improving and designing part of the code for the Haunted House game.

  Website to inform about aspect of the local environment

ICT112 Assignment - write a Python program that generates a small web site to inform Sunshine Coast people about some aspect of the local environment or a local sustainability issue.

  Fill in the python code

Fill in the Python code to play Tic Tac Toe. I won't award points unless it runs succesfully. # Tic-Tac-Toe Game def drawBoard(board): # Draws the board using the list of numbers print(" ") print(" ",board[0]," | ",board[1]," | ", board[2]) print("--..

  Program to do the enciphering

Write a program to do the enciphering. It should prompt the user for a message, and print out both the entered message and its corresponding ciphertext.

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