Computers and Technology

XML is the basis for many interfaces and web services. Consequently, reading and manipulating XML data is a common task in software development. Description
An online plant distributor has recently experience a shortage in its supply of Anemone plants such that the price has increased by 20%. Their plant catalog is maintained in an XML file and they need a Python utility to find the plant by name, read the current price, change it by the specified percentage, and update the file. Writing this utility is your assignment.
Using Python's ElementTree XML API, create a Python program to perform the following tasks below. Note that your program's execution syntax must be as follows:
python xmlparse. py plant_catalog. xml plantName percentChange
1. Using ElementTree, read in this assignments XML file plant_catalog. xml specified by a command line parameter as shown above.
2. Find the plant by the name passed in as an argument on the command line (plantName above).
3. Once found, read the current price and adjust it by the command line argument percentChange. Note that this value could be anything in the range of -90 < percentChange < 100.
For example, if you run your script as follows:
python plant_catalog. xml "Greek Valerian" -20
with the original XML containing:

Greek Valerian
Polemonium caeruleum
Annual
Shade
4.36
071499

The resulting file should contain:

Greek Valerian
Polemonium caeruleum
Annual
Shade
3.48
071499

Note: You may reduce the precision of the calculation if you wish but it isn't required.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 17:00, Dweath50
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server. so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
image
Computers and Technology, 22.06.2019 19:10, kaiya789
10. when you create a pivottable, you need to specify where to find the data for the pivottable. is it true
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, clevelandjaniya1
Which of these is a benefit of using objects in a powerpoint presentation? a. collaborators can create the external files while you create and edit the slide show. b. you can easily change the theme and design of the presentation. c. you can have older data in the source file while having up-to-date data in the presentation. d. collaborators can easily share the presentation.
Answers: 2
image
Computers and Technology, 23.06.2019 13:30, gamingisfun
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
Do you know the correct answer?
XML is the basis for many interfaces and web services. Consequently, reading and manipulating XML da...

Questions in other subjects:

Konu
Chemistry, 08.04.2021 01:10