<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://forum.ubuntu-fr.org/extern.php?action=feed&amp;tid=1062241&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / [Résolu] ! Script pour noms de musique]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=1062241</link>
		<description><![CDATA[Les sujets les plus récents dans [Résolu] ! Script pour noms de musique.]]></description>
		<lastBuildDate>Wed, 10 Oct 2012 05:49:32 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11069771#p11069771</link>
			<description><![CDATA[<p>tiens, du coup j&#039;ai corrigé il y avait une virgule en trop <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Wed, 10 Oct 2012 05:49:32 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11069771#p11069771</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11069741#p11069741</link>
			<description><![CDATA[<p>Utilise plutôt la syntaxe indiquée par nesthib en #27, plus concise :</p><div class="codebox"><pre><code>print( &quot;* %s (%s:%s)&quot; % ( (audio[&#039;TIT2&#039;],)+divmod(int(audio.info.length),60) ) )</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Wed, 10 Oct 2012 05:44:50 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11069741#p11069741</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11069041#p11069041</link>
			<description><![CDATA[<div class="quotebox"><cite>FelixP a écrit&#160;:</cite><blockquote><div><p>Et je sens que je vais me remettre à python… <img src="http://forum.ubuntu-fr.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p></div></blockquote></div><p>Excellente idée <img src="http://forum.ubuntu-fr.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>Essaie d&#039;améliorer ton script pour qu&#039;il parcoure les dossier et les sous-dossiers de ton dossier de musique (regarde le message <a href="./viewtopic.php?pid=11056941#p11056941">#24</a>). Essaie ensuite de générer ta sortie en une seule fois pour chaque dossier.</p><p>Ensuite, je ne sais pas exactement ce que tu veux faire sur wikipedia, mais il est possible d&#039;automatiser la tâche en envoyant automatiquement tes modifications.</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Tue, 09 Oct 2012 23:52:07 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11069041#p11069041</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11067821#p11067821</link>
			<description><![CDATA[<p>Je passe en résolu ! Merci de l&#039;aide !</p>]]></description>
			<author><![CDATA[dummy@example.com (FelixP)]]></author>
			<pubDate>Tue, 09 Oct 2012 20:55:43 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11067821#p11067821</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11067591#p11067591</link>
			<description><![CDATA[<p>Et je sens que je vais me remettre à python… <img src="http://forum.ubuntu-fr.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (FelixP)]]></author>
			<pubDate>Tue, 09 Oct 2012 20:42:32 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11067591#p11067591</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11067511#p11067511</link>
			<description><![CDATA[<p>Haha, ça fonctionne à la perfection !! Merci beaucoup !</p><div class="codebox"><pre><code>#!/usr/bin/env python
#coding: utf-8

from mutagen.mp3 import MP3
from mutagen.flac import FLAC
import os
import glob
os.chdir(&quot;/home/felix/Musique/ACDC/Live 1992&quot;)
#	print(&quot;{{Album|Titre=[[%s]]|Année=%s&quot; % (audio[&#039;TALB&#039;], audio[&#039;TDRC&#039;]))
for file in sorted(glob.glob(&quot;*.mp3&quot;)) :
	audio=MP3(file)
	print(&quot;* %s (%s:%s)&quot; % (audio[&#039;TIT2&#039;], int(audio.info.length)//60, int(audio.info.length%60)))</code></pre></div><p>---&gt;</p><div class="codebox"><pre class="vscroll"><code>* Thunderstruck (6:35)
* Shoot To Thrill (5:23)
* Back In Black (4:28)
* Sin City (5:40)
* Who Made Who (5:16)
* Heatseeker (3:37)
* Fire Your Guns (3:41)
* Jailbreak (14:43)
* The Jack (6:57)
* The Razors Edge (4:36)
* Dirty Deeds Done Dirt Cheap (5:3)
* Moneytalks (4:19)
* Hells Bells (6:2)
* Are You Ready (4:34)
* That&#039;s the Way I Wanna Rock&#039;N Roll (3:57)
* High Voltage (10:34)
* You Shook Me All Night Long (3:55)
* Whole Lotta Rosie (4:31)
* Let There Be Rock (12:18)
* Bonny (1:3)
* Highway To Hell (3:54)
* T.N.T. (3:48)
* For Those About To Rock (We Salute You) (7:8)


------------------
(program exited with code: 0)
Press return to continue</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (FelixP)]]></author>
			<pubDate>Tue, 09 Oct 2012 20:40:30 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11067511#p11067511</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11067061#p11067061</link>
			<description><![CDATA[<p>oups désolé j&#039;avais pas vu la 2e page du forum XD Je teste ça de suite !</p>]]></description>
			<author><![CDATA[dummy@example.com (FelixP)]]></author>
			<pubDate>Tue, 09 Oct 2012 20:14:33 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11067061#p11067061</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11066011#p11066011</link>
			<description><![CDATA[<p>ah oui, divmod te retourne un tuple… pour utiliser tout en même temps :</p><div class="codebox"><pre><code>print(&#039;%s %s %s&#039; % ((&#039;a&#039;,)+divmod(30,4)))</code></pre></div><p>NB. note bien la virgule du (…<strong>,</strong>)</p>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Tue, 09 Oct 2012 18:56:21 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11066011#p11066011</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11065551#p11065551</link>
			<description><![CDATA[<p>Pour l&#039;erreur&#160; du print :</p><div class="codebox"><pre><code>lon=int(audio.info.length)
print(&quot; %s (%s:%s)&quot; % (audio[&#039;TIT2&#039;], lon//60,lon%60))</code></pre></div><p>Pour avoir les fichiers par ordre alphabétique :</p><div class="codebox"><pre><code>for fic in sorted( glob.glob(&quot;*.mp3&quot;) ) :</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Tue, 09 Oct 2012 18:19:15 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11065551#p11065551</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11064671#p11064671</link>
			<description><![CDATA[<p>Génial <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />Mais alors j&#039;essaye d&#039;afficher le titre et la durée en même temps, </p><div class="codebox"><pre><code>print(&quot; %s (%s:%s)&quot; % (audio[&#039;TIT2&#039;], divmod(int(audio.info.length),60)))</code></pre></div><p>Mais cela ne fonctionne pas ! (Il faut que je me mette au python, moi…)</p><div class="codebox"><pre><code>print(&quot; %s (%s:%s)&quot; % (audio[&#039;TIT2&#039;], divmod(int(audio.info.length),60)))
TypeError: not enough arguments for format string</code></pre></div><p>De plus, je veux n&#039;afficher nom de l&#039;album et date qu&#039;une seule fois, alors comment puis-je dire à python d&#039;usiliser, par exemple, le premier fichier du dossier ? <img src="http://forum.ubuntu-fr.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /><br />Et par contre, les fichiers ne sont pas scannés dans l&#039;ordralphabétix… XD Savez-vous comment faire ? <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />Désolé pour tout ce que mon inculture de python vous inflige… <img src="http://forum.ubuntu-fr.org/img/smilies/wink.png" width="15" height="15" alt="wink" /></p>]]></description>
			<author><![CDATA[dummy@example.com (FelixP)]]></author>
			<pubDate>Tue, 09 Oct 2012 17:26:28 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11064671#p11064671</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11056941#p11056941</link>
			<description><![CDATA[<div class="quotebox"><cite>FelixP a écrit&#160;:</cite><blockquote><div><p>Savez-vous comment faire une boucle dans le dossier histoire de scanner tous les fichiers ? <img src="http://forum.ubuntu-fr.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p></div></blockquote></div><p>tu peux utiliser os.walk</p><div class="codebox"><pre><code>import os

for path, dirs, files in os.walk(&#039;/ton/chemin&#039;):
    print(&quot;Nous sommes dans %s&quot; % path)
    for file in files:
        print(&quot;Voici le fichier %s/%s&quot; % (path, file))</code></pre></div><p>pour un fichier donné tu peux faire :</p><div class="codebox"><pre><code>audio=MP3(os.path.join(path,file))
print(&#039;Album : %s\nAnnée : %s\nTitre : %s&#039;  % (audio[&#039;TALB&#039;], audio[&#039;TDRC&#039;], audio[&#039;TIT2&#039;]))</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (nesthib)]]></author>
			<pubDate>Mon, 08 Oct 2012 23:15:37 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11056941#p11056941</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11056031#p11056031</link>
			<description><![CDATA[<p>ça ne fonctionne pas <img src="http://forum.ubuntu-fr.org/img/smilies/sad.png" width="15" height="15" alt="sad" /></p><div class="codebox"><pre><code>    print(&quot;%s&quot;%audio[&#039;title&#039;])
  File &quot;/usr/lib/python2.7/site-packages/mutagen/__init__.py&quot;, line 84, in __getitem__
    else: return self.tags[key]
  File &quot;/usr/lib/python2.7/site-packages/mutagen/_util.py&quot;, line 108, in __getitem__
    return self.__dict[key]
KeyError: &#039;title&#039;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (FelixP)]]></author>
			<pubDate>Mon, 08 Oct 2012 21:29:08 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11056031#p11056031</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11055931#p11055931</link>
			<description><![CDATA[<p>Essayer :</p><div class="codebox"><pre><code>print(&quot;%s&quot;%audio[&#039;title&#039;])</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (pingouinux)]]></author>
			<pubDate>Mon, 08 Oct 2012 21:21:15 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11055931#p11055931</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11055841#p11055841</link>
			<description><![CDATA[<p>En tout cas ceci fonctionne très bien ! <img src="http://forum.ubuntu-fr.org/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (FelixP)]]></author>
			<pubDate>Mon, 08 Oct 2012 21:12:05 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11055841#p11055841</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  [Résolu] ! Script pour noms de musique]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11055831#p11055831</link>
			<description><![CDATA[<p>On peut récupérer le titre avec le nom de fichier simplement ?</p>]]></description>
			<author><![CDATA[dummy@example.com (FelixP)]]></author>
			<pubDate>Mon, 08 Oct 2012 21:09:53 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11055831#p11055831</guid>
		</item>
	</channel>
</rss>
