Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Python Expert

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.

Python, Programming

  • Category:- Python
  • Reference No.:- M92077329
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Python

Environment setupthe first mini project will be based on

Environment Setup The first mini project will be based on Ladder Logic programming. We will be using Schneider Electric's IDE called SoMachine Basic to do the programming. The latest ver- sion of SoMachine Basic for Wind ...

Learning outcomes lo3 - research develop and document a

Learning Outcomes LO3 - Research, develop, and document a basic security policy, and analyse, record, and resolve all security incidents LO4 - Identify and assess the threats to, and vulnerabilities of networks Assessmen ...

A software company sells a package that retails for 99

A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Quantity Discount 10 - 19 20% 20 - 49 30% 50 - 99 40% 100 or more 50% Write a program using python t ...

Question write a simple python program that takes use

Question: Write a simple python program that takes use inputs as non-zero digits and converts them into binary form. The response must be typed, single spaced, must be in times new roman font (size 12) and must follow th ...

Below zero - ice cream storethe local ice-cream store needs

Below Zero - ice cream store The local ice-cream store needs a new ordering system to improve customer service by streamlining the ordering process. The manager of the store has found that many orders are incorrect and s ...

Python programming assignment -you first need an abstract

Python Programming Assignment - You first need an abstract base class, called, Account which has the following attributes and methods: accountID: This attribute holds the ID assigned the account , if not provided set to ...

Question write a python program with a graphical user

Question: Write a python program with a graphical user interface that will allow a user to create a custom pizza which they wish to order. At minimum, the user should be able to choose the size of the pizza, the type of ...

Questionwhat is a python development frameworkgive 3

Question What is a python development framework? Give 3 examples python development framework used today. and explain which development framework is used in which industry.

Simple python traffic lightswrite a program that simulates

Simple Python (Traffic lights) Write a program that simulates a traffic light. The program lets the user select one of three lights: red, yellow, or green. When a radio button is selected, the light is turned on, and onl ...

Part i the assignment filesone of the most important

Part I: The Assignment Files One of the most important outcomes of this assignment is that you understand the importance of testing. This assignment will follow an iterative development cycle. That means you will write a ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As