Modifications

Sauter à la navigation Sauter à la recherche
1 495 octets ajoutés ,  28 janvier 2025 à 00:54
Ligne 110 : Ligne 110 :     
Voici quelques détails utiles concernant l'exemple:
 
Voici quelques détails utiles concernant l'exemple:
−
* '''Ligne 6''':
+
* '''Ligne 6''': chargement dynamique du fichier "songs.py". La collection SONGS qu'il contient est maintenant enregistré dans l'objet {{fname|buzzer}}.
−
* '''Ligne 7''':
+
* '''Ligne 7''': la méthode {{fname|dir_songs()}} permet d'obtenir une liste des noms de mélodie (contenu dans le fichier songs.py chargé).
−
* '''Ligne 11''':
+
* '''Ligne 11''': utilisation d'une boucle {{fname|for}} pour itérer, un à un, les différents noms de mélodies collecté en ligne 7.
−
* '''Ligne 13''':
+
* '''Ligne 13''': jouer la mélodie identifiée par son nom.
 +
 
 +
En plus du rendu audio, voici le résultat affiché dans la session REPL.
 +
 
 +
<nowiki>Available songs :
 +
['Super Mario - Main Theme', 'Super Mario - Title Music', 'SMBtheme', 'SMBwater', 'SMBunderground', 'Picaxe', 'The Simpsons', 'Indiana', 'TakeOnMe', 'Entertainer', 'Muppets', 'Xfiles', 'Looney', '20thCenFox', 'Bond', 'MASH', 'StarWars', 'GoodBad', 'TopGun', 'A-Team', 'Flinstones', 'Jeopardy', 'Gadget', 'Smurfs', 'MahnaMahna', 'LeisureSuit', 'MissionImp']
 +
 
 +
Playing Super Mario - Main Theme ...
 +
Playing Super Mario - Title Music ...
 +
Playing SMBtheme ...
 +
Playing SMBwater ...
 +
Playing SMBunderground ...
 +
Playing Picaxe ...
 +
Playing The Simpsons ...
 +
Playing Indiana ...
 +
Playing TakeOnMe ...
 +
Playing Entertainer ...
 +
Playing Muppets ...
 +
Playing Xfiles ...
 +
Playing Looney ...
 +
Playing 20thCenFox ...
 +
Playing Bond ...
 +
Playing MASH ...
 +
Playing StarWars ...
 +
Playing GoodBad ...
 +
Playing TopGun ...
 +
Playing A-Team ...
 +
Playing Flinstones ...
 +
Playing Jeopardy ...
 +
Playing Gadget ...
 +
Playing Smurfs ...
 +
Playing MahnaMahna ...
 +
Playing LeisureSuit ...
 +
Playing MissionImp ...
 +
</nowiki>
32 920

modifications

Menu de navigation