Lab05 2024 Boustil DSS

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Université de M’hamed Bouguerra Boumerdès

University of M'hamed Bouguerra Boumerdès


Faculty of Sciences - Department of Computer Science
Sector: L3 (ISIL+SI)
Year: 2023-2024
Module: DSS

Lab No. 5: XML in Python


Objective: Program XML in Python.
Noticed: Python.

Introduction to Python
• Write a function that checks if a number is prime and display the first 10 prime numbers.
• Create the dictionary dict={"nom":"firgani","ville":"annaba","site": "http://firgani.dz"}
• Create a list containing the keys of this dictionary.
• Create a list containing the values of this dictionary.
• Create a list containing the key-value pairs.
Exercise 1 (Python and DOM)

Using DOM, display the list of all artists, their cities, and their biographies.

Exercise 2 (Python and SAX)

Using Sax, display in an HTML page the list of all album titles and their release years.

Exercise 3 (Python and ElementTree)

<?xml version="1.0" encoding="UTF-8"?>


<graphe xmlns:xsl="http://www.graphe.org" nbs="3">
<sommet setiq="a01" marqué="oui"/>
<sommet setiq="b01" marqué="oui"/>
<sommet setiq="b02" marqué="non"/>
<arc sommet="a01" sbut="b01">
<aetiq>32</aetiq>
<cout>400</cout>
</arc>
<arc sommet="a01" sbut="b02" >
<aetiq>40</aetiq>
<cout>200</cout>
</arc>
<arc sommet="b01" sbut="b02" >
<aetiq>13</aetiq>
<cout>340</cout>
</arc>
</graphe>
Using the ElementTree API, write the code to display the sum of weights and the number of outgoing arcs
for vertices marked "yes":
Example
3 b01
destination nbre d'acrs somme poids
a01 2 43
3
b01 1 3 a01 40
b02
Part 2 of the project to be submitted

Description:
Develop an application Web in Python allowing users to search for information about musical artists and their
albums from a predefined XML file. The application should load data from the XML file, allow users to
search for artists by their name, display detailed information about the artist including their name, city of
origin, biography, and website (if available), display details of albums associated with the artist including
album title, release year, and list of songs.

Expected Features:
• Load data from an XML file containing information about artists and their albums.
• Allow users to search for an artist by their name.
• Display detailed information about the found artist, including their name, city of origin, biography, and
website (if available).
• Display details of albums associated with the artist, including the album title, release year, and list of
songs.
• Provide a simple command-line interface for user interaction.
• Allow the user to quit the application at any time.

Technical Constraints:
Use the ElementTree library for XML file processing.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy