lueur de Narsil
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.


BIENVENUS
 
AccueilDernières imagesRechercherS'enregistrerConnexion
Derniers sujets
» chefs et officiers
a tout hazrd! Icon_minitimeMer 06 Nov 2013, 10:53 par Dramdun

» suivi SWOTOR
a tout hazrd! Icon_minitimeVen 26 Avr 2013, 09:41 par nikodor

» CV du blackPhoenix
a tout hazrd! Icon_minitimeMar 12 Mar 2013, 20:37 par BlackPhoenix

» Candidature Gootrek
a tout hazrd! Icon_minitimeVen 08 Fév 2013, 15:03 par yamane

» A mon grand regret
a tout hazrd! Icon_minitimeJeu 07 Fév 2013, 19:50 par Dramdun

» La Charte de confrérie
a tout hazrd! Icon_minitimeJeu 07 Fév 2013, 09:37 par DonNoNO

» Recrutement
a tout hazrd! Icon_minitimeMar 05 Fév 2013, 07:33 par yamane

» Annulation Helegrod de vendredi 01/02/213, remplacé par Annuminas
a tout hazrd! Icon_minitimeVen 01 Fév 2013, 10:38 par nikodor

» Nettoyage du livre des prouesses
a tout hazrd! Icon_minitimeVen 25 Jan 2013, 23:26 par titebabs

MUMBLE
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
star
raid planner
Le Deal du moment :
Bon plan achat en duo : 2ème robot cuiseur ...
Voir le deal
600 €

 

 a tout hazrd!

Aller en bas 
5 participants
AuteurMessage
Dramdun




Messages : 84
Date d'inscription : 07/05/2012
Age : 49
Localisation : caen (14)

a tout hazrd! Empty
MessageSujet: a tout hazrd!   a tout hazrd! Icon_minitimeMer 24 Oct 2012, 17:02

quelqu'un aurait une idee sur le bug?

Code:
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> from functools import partial
>>> import tkinter as tk
>>>
>>> root = tk.Tk()

>>> class Allo_IHM(object):
   def __init__(self, fic):
      self.phoneList = []
      self.fic = fic
      f = open(fic)
      try:
         for line in f:
            self.phoneList.append(line[: -1].split('*'))
      except:
         f = open(self.fic, "w")
      finally:
         f.close()
      self.phoneList.sort()
      self.root = tk.Tk()
      self.root.title("Allo !")
      self.root.config(relief=tk.RAISED, bd=3)
      self.makeWidgets()
      self.root.mainloop()
   def makeWidgets(self):
                                        # frame "saisie" (en haut avec bouton d'effacement)
                                        frameH = tk.Frame(self.root, relief=tk.GROOVE, bd=2)
                                        frameH.pack()
                                        tk.Label(frameH, text="Nom :").grid (row=0, column=0, sticky=tk.W)
                                        self.nameEnt = tk.Entry(frameH)
                                        self.nameEnt.grid(row=0, column=1, sticky=tk.W, padx=5, pady=10)
                                        tk.Label (framH, text="tel :").grid(row=1, column=0, sticky=tk.W)
                                        self.phoneEnt = tk.Entry(frameH)
                                        self.phoneEnt.grid(row=1, column=1, sticky=tk.W, pasx=5, pady=2)
                                        b = tk.button(frameH, text="Effacer ", command=self.clear)
                                        b.grid(row=2, column=0, columnspan=2, pady=3)
                                        # frame "liste" (au milieu)
                                        frameM = tk.Frame(self.root)
                                        frameM.pack()
                                        self.scroll = tk.Scrollbar(frameM)
                                        self.select = tk.Listbox(frameM, yscrollcommand=self.scroll.set, height=6)
                                        self.scroll.config(command=self.select.yview)
                                        self.scroll.pack(side=tk.RIGHT, fill=tk.Y, pady=5)
                                        self.select.pack(side=tk.LEFT, fill=tk.BOTH, expand=1, pady=5)
                                        ## remplissage de la listbox
                                        for i in self.phoneList:
                                                self.select.insert(tk.END, i[0])
                                        self.select.bind("<Double-Button-1>", lambda event: self.afficher(event))
                                        # frame "boutons" (en bas)
                                        frameB = tk.Frame(self.root, relief=tk.GROOVE, bd=3)
                                        frameB.pack(pady=3)
                                        b1 = tk.Button(frameB, text="Ajouter ", command=self.ajouter)
                                        b2 = tk.Button(frameB, text="Supprimer", command=self.supprimer)
                                        b3 = tk.Button(frameB, text="Afficher ", command=self.afficher)
                                        b1.pack(side=tk.LEFT, pady=2)
                                        b2.pack(side=tk.LEFT, pady=2)
                                        b3.pack(side=tk.LEFT, pady=2)
                        def ajouter(self):
                                pass
                        def supprimer(self):
                                pass
                        def afficher(self, event=None):
                                pass
                        def clear(self):
                                pass

#auto-test -----------------------------------------------------------------------------------------------------------------------------
if __name__== '__main__':
        app = Allo_IHM('phones.txt')
Revenir en haut Aller en bas
ElysiuM




Messages : 79
Date d'inscription : 09/05/2012
Age : 37
Localisation : Belgique

a tout hazrd! Empty
MessageSujet: Re: a tout hazrd!   a tout hazrd! Icon_minitimeMer 24 Oct 2012, 17:49

Absolument aucune dram, mais je répond pour te faire savoir que le message a quand même été lu Wink
Revenir en haut Aller en bas
ikeny




Messages : 7
Date d'inscription : 25/10/2012

a tout hazrd! Empty
MessageSujet: Re: a tout hazrd!   a tout hazrd! Icon_minitimeJeu 25 Oct 2012, 20:03

merci ely...
j'avais quand meme peu d'espoir de trouver une solution aussi facilement...Wink


bref vous m'aurais reconnu = DRAM!
vi j'ai oublier mon mot de pass alors nouveau compte!!!
quand on a pas de tete...
Revenir en haut Aller en bas
nikodor

nikodor


Messages : 116
Date d'inscription : 04/05/2012

a tout hazrd! Empty
MessageSujet: Re: a tout hazrd!   a tout hazrd! Icon_minitimeVen 26 Oct 2012, 19:54

voilà ce que l'on peut traduire :

a tout hazrd! Latex-1
a tout hazrd! Latex-1, a tout hazrd! Latex-1 et a tout hazrd! Latex-1.

mais !!!

a tout hazrd! Latex-1a tout hazrd! Latex-1 et a tout hazrd! Latex-1

voir aussi !

a tout hazrd! Latex-1A = a tout hazrd! Latex-1.

sinon, ben....démerde toi tout seul cheers MOUHAHAHAHAHAHAHAHAHA !!!!
Revenir en haut Aller en bas
ElysiuM




Messages : 79
Date d'inscription : 09/05/2012
Age : 37
Localisation : Belgique

a tout hazrd! Empty
MessageSujet: Re: a tout hazrd!   a tout hazrd! Icon_minitimeDim 28 Oct 2012, 08:35

Enfoiré niko xD
Revenir en haut Aller en bas
ikeny




Messages : 7
Date d'inscription : 25/10/2012

a tout hazrd! Empty
MessageSujet: Re: a tout hazrd!   a tout hazrd! Icon_minitimeDim 04 Nov 2012, 17:03

on peut fermé le post, probleme resolu
l'anomalie venait de l'interpreteur....

merci
Revenir en haut Aller en bas
Skaronte

Skaronte


Messages : 63
Date d'inscription : 14/05/2012
Age : 32

a tout hazrd! Empty
MessageSujet: Re: a tout hazrd!   a tout hazrd! Icon_minitimeLun 05 Nov 2012, 13:23

Au moins niko peut faire semblant de comprendre et d'être intelligent ^^
Revenir en haut Aller en bas
ikeny




Messages : 7
Date d'inscription : 25/10/2012

a tout hazrd! Empty
MessageSujet: Re: a tout hazrd!   a tout hazrd! Icon_minitimeMar 06 Nov 2012, 16:35

juste histoir, un petit programme qui sert a rien, et qui tape sur les nerfs au bout d'un moment, la balle ne fait que de se promener dans la fenetre:

Citation :
Python 2.7.3 (default, Aug 1 2012, 05:14:39)
[GCC 4.6.3] on linux2
Type "copyright", "credits" or "license()" for more information.
==== No Subprocess ====
>>> from Tkinter import *
>>>
>>> # Définition des gestionnaires d'événements :
>>> def move():
"déplacement de la balle"
global x1, y1, dx, dy, flag
x1, y1, = x1 +dx, y1 +dy
if x1 > 210:
x1, dx, dy = 210, 0, 15
if y1 > 210:
y1, dx, dy = 210, -15, 0
if x1 < 10:
x1, dx, dy = 10, 0, -15
if y1 < 10:
y1, dx, dy = 10, 15, 0
can1.coords(oval1,x1,y1,x1+30,y1+30)
if flag > 0:
fen1.after(50,move) # Boucler après 50 millisecondes


>>> def stop_it():
"arret de l'animation"
global flag
flag = 0


>>> def start_it():
"démarrage de l'animation"
global flag
if flag == 0: # Pour ne lancer qu'une seule boucle
flag = 1
move()


>>> # --------------- Programme Principal ---------------
>>> # Les variables suivantes seront utilisées de manière globale :
>>> x1, y1 = 10, 10 # coordonnées initiales
>>> dx, dy = 15, 0 # 'pas' du déplacement
>>> flag = 0 # commutateur
>>> # Création du widget principal ("parent"):
>>> fen1 = Tk()
>>> fen1.title("Animation automatique avec Tkinter")
''
>>> # Création des widgets "enfants":
>>> can1 = Canvas(fen1, bg='dark grey', height=250, width=250)
>>> can1.pack(side=LEFT, padx=5, pady=5)
>>> oval1 = can1.create_oval(x1, y1, x1+30, y1+30, width=2, fill='red')
>>> bou1 = Button(fen1, text='Quitter', width =8, command=fen1.quit)
>>> bou1.pack(side=BOTTOM)
>>> bou2 = Button(fen1, text='Démarrer', width =8, command=start_it)
>>> bou2.pack()
>>> bou3 = Button(fen1, text='Arrêter', width =8, command=stop_it)
>>> bou3.pack()
>>> # Démarrage du réceptionnaire d'événements (boucle principale) :
>>> fen1.mainloop()


[img]a tout hazrd! Captur11[/img]
Revenir en haut Aller en bas
Contenu sponsorisé





a tout hazrd! Empty
MessageSujet: Re: a tout hazrd!   a tout hazrd! Icon_minitime

Revenir en haut Aller en bas
 
a tout hazrd!
Revenir en haut 
Page 1 sur 1

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
lueur de Narsil :: divers :: Hors jeu !!!-
Sauter vers: