<?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=1131121&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Forum Ubuntu-fr.org / Besoin de conseils pour débuter en python]]></title>
		<link>http://forum.ubuntu-fr.org/viewtopic.php?id=1131121</link>
		<description><![CDATA[Les sujets les plus récents dans Besoin de conseils pour débuter en python.]]></description>
		<lastBuildDate>Sun, 23 Dec 2012 17:21:59 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11967241#p11967241</link>
			<description><![CDATA[<p>Merci <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" />, mais j&#039;ai pas trop compris à quoi sert la commande hg clone...</p><p>pygame semble être installé correctement maintenant <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Mais quand je lance ce programme depuis Geany:</p><div class="codebox"><pre><code>#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys, pygame
pygame.init()

size = width, height = 320, 240
speed = [2, 2]
black = 0, 0, 0
  
screen = pygame.display.set_mode(size)
    
ball = pygame.image.load(&quot;ball.bmp&quot;)
ballrect = ball.get_rect()
    
while 1:
    for event in pygame.event.get():
        if event.type == pygame.QUIT: sys.exit()

        ballrect = ballrect.move(speed) 
        if ballrect.left &lt; 0 or ballrect.right &gt; width:
            speed[0] = -speed[0]
        if ballrect.top &lt; 0 or ballrect.bottom &gt; height:
            speed[1] = -speed[1]
   
        screen.fill(black)
        screen.blit(ball, ballrect)
        pygame.display.flip()</code></pre></div><p>j&#039;ai ce message d&#039;érreur:</p><div class="codebox"><pre><code> File &quot;pygame-exemple.py&quot;, line 4, in &lt;module&gt;
 import pygame
ImportError: No module named pygame</code></pre></div><p>Et quand je lance le programme avec la commande: <strong>python3 pygame-exemple</strong> dans un terminal çà fonctionne...<br />Comment ça ce fait que çà ne marche depuis Geany???</p>]]></description>
			<author><![CDATA[dummy@example.com (brital)]]></author>
			<pubDate>Sun, 23 Dec 2012 17:21:59 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11967241#p11967241</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11966561#p11966561</link>
			<description><![CDATA[<p>D&#039;après cette page<br /><a href="http://www.pygame.org/wiki/CompileUbuntu?parent=Compilation">http://www.pygame.org/wiki/CompileUbunt … ompilation</a></p><p>ceci devrait aller</p><div class="codebox"><pre><code>sudo apt-get install python3-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev
 
hg clone https://bitbucket.org/pygame/pygame
 
cd pygame
python3 setup.py build
sudo python3 setup.py install</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (VinsS)]]></author>
			<pubDate>Sun, 23 Dec 2012 16:10:09 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11966561#p11966561</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11964321#p11964321</link>
			<description><![CDATA[<p>Merci <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Maintenant, j&#039;ai un autre problème:<br />J&#039;ai installé pygame par synaptic, et quand j&#039;essaye l&#039;exemple de code suivant:</p><div class="codebox"><pre><code>#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys, pygame
pygame.init()

size = width, height = 320, 240
speed = [2, 2]
black = 0, 0, 0
  
screen = pygame.display.set_mode(size)
    
ball = pygame.image.load(&quot;ball.bmp&quot;)
ballrect = ball.get_rect()
    
while 1:
    for event in pygame.event.get():
        if event.type == pygame.QUIT: sys.exit()

        ballrect = ballrect.move(speed) 
        if ballrect.left &lt; 0 or ballrect.right &gt; width:
            speed[0] = -speed[0]
        if ballrect.top &lt; 0 or ballrect.bottom &gt; height:
            speed[1] = -speed[1]
   
        screen.fill(black)
        screen.blit(ball, ballrect)
        pygame.display.flip()</code></pre></div><p>Quand je lance le programme j&#039;ai le message d&#039;erreur suivant:</p><div class="codebox"><pre><code>  File &quot;pygame.py&quot;, line 3, in &lt;module&gt;
    import sys, pygame
  File &quot;/home/alex/Bureau/python/exercice/pygame.py&quot;, line 4, in &lt;module&gt;
    pygame.init()
AttributeError: &#039;module&#039; object has no attribute &#039;init&#039;</code></pre></div><p>J&#039;ai lu quelque part que le dépôt python-pygame (1.9.1) qui se trouve dans synaptic est conçu pour tourner sur python2.6...</p><p>Moi, j&#039;utilise python3.2 et sur le site officiel je ne trouve pas la version de pygame qui tourne avec cette version de python(<a href="http://www.pygame.org/download.shtml">http://www.pygame.org/download.shtm</a>l).</p><p>Quelqu&#039;un pourrais t&#039;il m&#039;indiquer la marche à suivre pour installer pygame pour python3.2?</p>]]></description>
			<author><![CDATA[dummy@example.com (brital)]]></author>
			<pubDate>Sun, 23 Dec 2012 12:06:07 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11964321#p11964321</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11945181#p11945181</link>
			<description><![CDATA[<div class="codebox"><pre><code># -*- coding: utf-8 -*-

t1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12]
t2 = [&#039;Janvier&#039;, &#039;Fevrier&#039;, &#039;Mars&#039;, &#039;Avril&#039;, &#039;Mai&#039;, &#039;Juin&#039;,&#039;Juillet&#039;,
        &#039;Aout&#039;, &#039;Septembre&#039;, &#039;Octobre&#039;, &#039;Novembre&#039;, &#039;Decembre&#039;]

# Méthode longue

t3 = []
for i, t in enumerate(t1):
    t3.append(str(t))
    t3.append(t2[i])

ch = &#039;, &#039;.join(t3)

print(ch)

# Méthode simple (ou compliquée selon le point de vue)

ch = &#039;, &#039;.join([&#039;%s, %s&#039; %(str(x), z) for x, z in [y for y in zip(t1, t2)]])

print(ch)</code></pre></div><p>Bon <span class="bbs">apocalypse</span> Python.</p>]]></description>
			<author><![CDATA[dummy@example.com (VinsS)]]></author>
			<pubDate>Fri, 21 Dec 2012 12:05:53 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11945181#p11945181</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11935071#p11935071</link>
			<description><![CDATA[<p>oui j&#039;ai trouvé <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Quelqu&#039;un pourrait me dire comment on se sert du générateur de documentation de geany?<br />Comment peut on s&#039;assurer que geany lance le script en python3 et non pas dans une ancienne version de python?</p><p>J&#039;ai commencé a étudier python(variable, type, boucle, condition, liste, ...) avec l&#039;excellent livre de Gérard Swinnen <a href="http://inforef.be/swi/python.htm">http://inforef.be/swi/python.htm</a>&#160; et maintenant je commence les fonctions, je trouve vraiment ce langage vraiment facile à apprendre.</p><p>J&#039;ai un petit souci avec la fonction print(), par exemple dans le programme suivant:</p><div class="codebox"><pre><code>t1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12]
t2 = [&#039;Janvier&#039;, &#039;Fevrier&#039;, &#039;Mars&#039;, &#039;Avril&#039;, &#039;Mai&#039;, &#039;Juin&#039;,&#039;Juillet&#039;,
 &#039;Aout&#039;, &#039;Septembre&#039;, &#039;Octobre&#039;, &#039;Novembre&#039;, &#039;Decembre&#039;]
t3 = []

n = 0
while n &lt; len(t1) :
	t3.append(t1[n])
	t3.append(t2[n])
	n= n+ 1 	
print(t3)

#affiche le résultat:
&gt;&gt;&gt;[1, &#039;Janvier&#039;, 2, &#039;Fevrier&#039;, 3, &#039;Mars&#039;, 4, &#039;Avril&#039;, 5, &#039;Mai&#039;, 6, &#039;Juin&#039;, 7, &#039;Jui
llet&#039;, 8, &#039;Aout&#039;, 9, &#039;Septembre&#039;, 10, &#039;Octobre&#039;, 12, &#039;Novembre&#039;]</code></pre></div><p>,<br />Je voudrais formater l&#039;affichage du texte à l&#039;écran pour le rendre plus &quot;propre&quot; dans le genre de çà:</p><div class="codebox"><pre><code>&gt;&gt;&gt;1, janvier 2, Fevrier, 3, Mars 4, Avril, ...</code></pre></div><p>Ou afficher les mois de l&#039;année en deux colonnes...</p>]]></description>
			<author><![CDATA[dummy@example.com (brital)]]></author>
			<pubDate>Thu, 20 Dec 2012 13:56:18 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11935071#p11935071</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11907531#p11907531</link>
			<description><![CDATA[<p>Tu ne trouve rien sur ce <a href="http://www.developpez.com/">site</a>?</p>]]></description>
			<author><![CDATA[dummy@example.com (Korak)]]></author>
			<pubDate>Mon, 17 Dec 2012 19:07:57 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11907531#p11907531</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11906741#p11906741</link>
			<description><![CDATA[<p>Il y a <a href="http://www.python.org/doc/">la doc officielle</a>, même si elle n&#039;est pas en français, c&#039;est je pense la meilleure façon de se renseigner. Il y a même des tutos pour débuter (en anglais aussi).</p>]]></description>
			<author><![CDATA[dummy@example.com (Sga64)]]></author>
			<pubDate>Mon, 17 Dec 2012 18:06:15 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11906741#p11906741</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11903291#p11903291</link>
			<description><![CDATA[<p>Les liens pour télécharger les exemples de code<a href="http://python.developpez.com/sources/">http://python.developpez.com/sources/</a> <img src="http://forum.ubuntu-fr.org/img/smilies/sad.png" width="15" height="15" alt="sad" /></p><p>Je suis aussi à la recherche d&#039;une documentation sur la bibliothèque standard de python, si possible en Français ...</p>]]></description>
			<author><![CDATA[dummy@example.com (brital)]]></author>
			<pubDate>Mon, 17 Dec 2012 12:36:01 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11903291#p11903291</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11881671#p11881671</link>
			<description><![CDATA[<p>Tu ne trouves pas ton bonheur <a href="http://python.developpez.com/cours/">ici</a> ou <a href="http://python.developpez.com/sources/">ici</a>?</p>]]></description>
			<author><![CDATA[dummy@example.com (Korak)]]></author>
			<pubDate>Sat, 15 Dec 2012 16:28:52 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11881671#p11881671</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11879341#p11879341</link>
			<description><![CDATA[<p>Merci <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Existe t&#039;il des exemples d&#039;applications avec tuto?</p>]]></description>
			<author><![CDATA[dummy@example.com (brital)]]></author>
			<pubDate>Sat, 15 Dec 2012 11:47:23 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11879341#p11879341</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11870671#p11870671</link>
			<description><![CDATA[<p>Sinon, j&#039;ai appris Python avec <a href="http://www.swaroopch.com/notes/Python_fr-Table_des_Mati%C3%A8res/">ça</a>. Le but du tuto est d&#039;être accessible et utile autant aux débutants qu&#039;aux programmeurs expérimentés.</p>]]></description>
			<author><![CDATA[dummy@example.com (Sga64)]]></author>
			<pubDate>Fri, 14 Dec 2012 15:49:36 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11870671#p11870671</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11870331#p11870331</link>
			<description><![CDATA[<p>Oui c&#039;est de çà que je parlais... <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />Mais quand j&#039;ai écrit mon dernier post, je n&#039;avais dit que mes premières impressions. Maintenant que je parcours ce pdf plus sérieusement, il me semble bien fait, et me convient parfaitement.</p>]]></description>
			<author><![CDATA[dummy@example.com (brital)]]></author>
			<pubDate>Fri, 14 Dec 2012 15:33:19 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11870331#p11870331</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11866631#p11866631</link>
			<description><![CDATA[<div class="quotebox"><cite>brital a écrit&#160;:</cite><blockquote><div><p>Merci, cette documentation me semble plutôt complète et complexe pour un débutant python <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p></div></blockquote></div><p>Complexe, non je ne pense pas.<br />Du moins ce n’est pas le but.</p><div class="quotebox"><cite>Introduction à Python 3 a écrit&#160;:</cite><blockquote><div><p>Outre ce cadre universitaire assez réduit, ce cours s’adresse à toute personne désireuse d’apprendre Python en tant que premier langage de programmation.</p></div></blockquote></div><p>On parle bien de la même chose (à savoir, <a href="http://www.afpy.org/Members/bcordeau/Python3v1-1.pdf/download">ça</a>) ?</p>]]></description>
			<author><![CDATA[dummy@example.com (grim7reaper)]]></author>
			<pubDate>Fri, 14 Dec 2012 10:55:43 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11866631#p11866631</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11866501#p11866501</link>
			<description><![CDATA[<p>Merci, cette documentation me semble plutôt complète et complexe pour un débutant python <img src="http://forum.ubuntu-fr.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Au fait comment je fais pour exécuter le codepython que je tape dans Geany?</p>]]></description>
			<author><![CDATA[dummy@example.com (brital)]]></author>
			<pubDate>Fri, 14 Dec 2012 10:49:10 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11866501#p11866501</guid>
		</item>
		<item>
			<title><![CDATA[Réponse à&#160;:  Besoin de conseils pour débuter en python]]></title>
			<link>http://forum.ubuntu-fr.org/viewtopic.php?pid=11866291#p11866291</link>
			<description><![CDATA[<p>Ok, donc en français il y a <a href="http://www.afpy.org/Members/tarek/initiation-python-3">ça</a>.<br />Le problème des ressources en français c‘est qu‘elles ne couvrent pas souvent Python 3, c’est un peu con quand même.</p>]]></description>
			<author><![CDATA[dummy@example.com (grim7reaper)]]></author>
			<pubDate>Fri, 14 Dec 2012 10:21:30 +0000</pubDate>
			<guid>http://forum.ubuntu-fr.org/viewtopic.php?pid=11866291#p11866291</guid>
		</item>
	</channel>
</rss>
