Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 04/10/2009, à 11:57

jouclar

[RESOLU] Python Problème IDLE

Bonjour à tous,

J'ai décidé d'apprendre à programmer en utilisant Python. Je commence donc en utilisant IDLE l'IDE de base de Python et là c'est le drame.
Lorsque je tape "(" de range dans le code :

for i in range(10):
   print i,

j'ai des messages d'erreurs qui apparaissent :

Python 2.5.4 (r254:67916, Apr  4 2009, 17:55:16) 
[GCC 4.3.3] on linux2
Type "copyright", "credits" or "license()" for more information.

    ****************************************************************
    Personal firewall software may warn about the connection IDLE
    makes to its subprocess using this computer's internal loopback
    interface.  This connection is not visible on any external
    interface and no data is sent to or received from the Internet.
    ****************************************************************
    
IDLE 1.2.4      ==== No Subprocess ====
>>> Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1417, in __call__
    return self.func(*args)
  File "/usr/lib/python2.5/idlelib/MultiCall.py", line 151, in handler
    r = l[i](event)
  File "/usr/lib/python2.5/idlelib/CallTips.py", line 55, in try_open_calltip_event
    self.open_calltip(False)
  File "/usr/lib/python2.5/idlelib/CallTips.py", line 79, in open_calltip
    self.calltip.showtip(arg_text, sur_paren[0], sur_paren[1])
  File "/usr/lib/python2.5/idlelib/CallTipWindow.py", line 66, in showtip
    self.position_window()
  File "/usr/lib/python2.5/idlelib/CallTipWindow.py", line 35, in position_window
    self.parencol))
  File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 2860, in bbox
    self.tk.call((self._w, 'bbox') + args)) or None
  File "/usr/lib/python2.5/lib-tk/Tkinter.py", line 1033, in _getints
    return tuple(map(getint, self.tk.splitlist(string)))
ValueError: invalid literal for int() with base 10: '(151,'
for i in range(

je ne comprend pas pourquoi. Merci de votre aide.

Dernière modification par jouclar (Le 04/10/2009, à 21:42)


Ubuntu 9.04

Hors ligne

#2 Le 04/10/2009, à 12:48

toitoinebzh

Re : [RESOLU] Python Problème IDLE

salut
tu as installer comment idle
chez moi, j'ai une install par défaut et j'ai python 2.6.2 et idle2.6.2
chez toi tu as python 2.5 et idle 1.2.4

Hors ligne

#3 Le 04/10/2009, à 13:12

jouclar

Re : [RESOLU] Python Problème IDLE

Merci pour ta réponse

J'ai installé via Ajouter/supprimer


Ubuntu 9.04

Hors ligne

#4 Le 04/10/2009, à 20:19

jouclar

Re : [RESOLU] Python Problème IDLE

please un peu d'aide svp


Ubuntu 9.04

Hors ligne

#5 Le 04/10/2009, à 20:27

Michel Leunen

Re : [RESOLU] Python Problème IDLE

Et si tu te passes de idle.
Ouvre un teminal, tape python puis ton code:

$ python
Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) 
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> for i in range(10):
...   print i,
... 
0 1 2 3 4 5 6 7 8 9
>>>

Ou bien, utilise gedit. Sauve ton code dans un fichier puis tu le lances en tapant:

$ python mon_fichier.py

Pour des petits programmes en python ou autre langage, j'utilise geany (c'est dans les dépôts). C'est une mini-IDE vraiment pas mal.
1Autre solution, installe Eric qui est un IDE complet pour python.


Michel Leunen
http://linux.leunen.com

Hors ligne

#6 Le 04/10/2009, à 20:55

jouclar

Re : [RESOLU] Python Problème IDLE

merci pour ta réponse, mais je voulais utiliser le même IDE sous windows (pour le travail) et ubuntu (pour la maison)

est il possible de désinstaller Python et de refaire l'install ??

Merci


Ubuntu 9.04

Hors ligne

#7 Le 04/10/2009, à 21:09

Michel Leunen

Re : [RESOLU] Python Problème IDLE

jouclar a écrit :

est il possible de désinstaller Python et de refaire l'install ??

Oui, via Synaptic. Mais si j'étais toi, je ne désinstallerais pas Python mais seulement IDLE. Ensuite réinstalle-le en faisant bien attention à la version. Les paquets s'appellent idle-python2.4, idle-python2.5 et idle-python2.6. Choisis bien la version qui correspond à ton python. Pour le savoir, tapes dans une console:

$ python --version

sous 9.04, il répond:

$ python --version
Python 2.6.2

Tu devrais donc installer idle-python2.6.


Michel Leunen
http://linux.leunen.com

Hors ligne

#8 Le 04/10/2009, à 21:24

Jean-Julien

Re : [RESOLU] Python Problème IDLE

Je viens d'assaier avec Python 2.6 et IDLE (pour 2.6) et ça fonctionne correctement.

(Ubuntu 9.04, Python 2.6.2, IDLE installé avec synaptic.)

Hors ligne

#9 Le 04/10/2009, à 21:27

Michel Leunen

Re : [RESOLU] Python Problème IDLE

Super! smile


Michel Leunen
http://linux.leunen.com

Hors ligne

#10 Le 04/10/2009, à 21:42

jouclar

Re : [RESOLU] Python Problème IDLE

Merci à tous ça marche tip top:lol:


Ubuntu 9.04

Hors ligne