IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Tkinter Python Discussion :

Ouverture d'une simple fenêtre Tkinter avec Pyzo sur Mac


Sujet :

Tkinter Python

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Candidat au Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Février 2015
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 29
    Localisation : France, Haute Vienne (Limousin)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2015
    Messages : 3
    Par défaut Ouverture d'une simple fenêtre Tkinter avec Pyzo sur Mac
    Bonsoir,

    Je cherche à créer une interface graphique à l'aide de tkinter sur Pyzo sur mac.
    J'ai lu de nombreux tutoriels mais aucune fenêtre ne s'ouvre.
    J'ai recopié ce code que j'ai trouvé sur :
    http://tarball69.developpez.com/tuto...-faq/#LIII-C-1

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    from tkinter import *
     
    fenetre = Tk()
     
    # mettez ici tout le code dont vous avez besoin
     
    Label(fenetre, text="Essai fenêtre").pack(pady=20, padx=10)
     
    Button(fenetre, text="Quitter", command=fenetre.destroy).pack(pady=5)
     
    # /!\ n'oubliez pas de finir avec la boucle principale /!\
     
    fenetre.mainloop()
    Mais je n'obtiens pas la fenêtre attendue , ni de fenêtre tout court d'ailleurs!

    http://tarball69.developpez.com/tuto...7E7CBAC2BF.png

    Voici ce que j'obtiens :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    In [9]: (executing lines 1 to 14 of "<tmp 5>")
    2015-02-09 01:52:32.756 python3[6387:352789] -[QNSApplication _setup:]: unrecognized selector sent to instance 0x1068a14c0
    2015-02-09 01:52:32.760 python3[6387:352789] (
    	0   CoreFoundation                      0x00007fff9244364c __exceptionPreprocess + 172
    	1   libobjc.A.dylib                     0x00007fff928206de objc_exception_throw + 43
    	2   CoreFoundation                      0x00007fff924466bd -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    	3   CoreFoundation                      0x00007fff9238da84 ___forwarding___ + 1028
    	4   CoreFoundation                      0x00007fff9238d5f8 _CF_forwarding_prep_0 + 120
    	5   libtk8.5.dylib                      0x000000011049f036 TkpInit + 428
    	6   libtk8.5.dylib                      0x00000001104179d2 Initialize + 1704
    	7   _tkinter.so                         0x0000000107461f9d Tcl_AppInit + 77
    	8   _tkinter.so                         0x000000010745ef07 Tkinter_Create + 919
    	9   libpython3.4m.dylib                 0x00000001000e57ea PyEval_EvalFrameEx + 31306
    	10  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	11  libpython3.4m.dylib                 0x000000010003eb2a function_call + 186
    	12  libpython3.4m.dylib                 0x000000010000d738 PyObject_Call + 104
    	13  libpython3.4m.dylib                 0x00000001000288bc method_call + 140
    	14  libpython3.4m.dylib                 0x000000010000d738 PyObject_Call + 104
    	15  libpython3.4m.dylib                 0x000000010007b611 slot_tp_init + 81
    	16  libpython3.4m.dylib                 0x0000000100072da4 type_call + 212
    	17  libpython3.4m.dylib                 0x000000010000d738 PyObject_Call + 104
    	18  libpython3.4m.dylib                 0x00000001000e1ff4 PyEval_EvalFrameEx + 16980
    	19  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	20  libpython3.4m.dylib                 0x00000001000e6adf PyEval_EvalCode + 63
    	21  libpython3.4m.dylib                 0x00000001000db1ee builtin_exec + 206
    	22  libpython3.4m.dylib                 0x00000001000e57ea PyEval_EvalFrameEx + 31306
    	23  libpython3.4m.dylib                 0x00000001000e5750 PyEval_EvalFrameEx + 31152
    	24  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	25  libpython3.4m.dylib                 0x00000001000e55b6 PyEval_EvalFrameEx + 30742
    	26  libpython3.4m.dylib                 0x00000001000e5750 PyEval_EvalFrameEx + 31152
    	27  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	28  libpython3.4m.dylib                 0x000000010003eb2a function_call + 186
    	29  libpython3.4m.dylib                 0x000000010000d738 PyObject_Call + 104
    	30  libpython3.4m.dylib                 0x00000001000288bc method_call + 140
    	31  libpython3.4m.dylib                 0x000000010000d738 PyObject_Call + 104
    	32  libpython3.4m.dylib                 0x00000001000dc147 PyEval_CallObjectWithKeywords + 87
    	33  libpyside.cpython-34m.1.2.1.dylib   0x00000001046696fa _ZN6PySide13SignalManager20callPythonMetaMethodERK11QMetaMethodPPvP7_objectb + 138
    	34  libpyside.cpython-34m.1.2.1.dylib   0x000000010466fa0c _ZN6PySide16GlobalReceiverV211qt_metacallEN11QMetaObject4CallEiPPv + 172
    	35  QtCore                              0x00000001048258b2 _ZN11QMetaObject8activateEP7QObjectPKS_iPPv + 2146
    	36  QtCore.so                           0x0000000104456f52 _ZN13QTimerWrapper10timerEventEP11QTimerEvent + 146
    	37  QtCore                              0x00000001048214e0 _ZN7QObject5eventEP6QEvent + 432
    	38  QtCore.so                           0x0000000104457483 _ZN13QTimerWrapper5eventEP6QEvent + 307
    	39  QtGui                               0x0000000105a241dd _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 189
    	40  QtGui                               0x0000000105a2ac94 _ZN12QApplication6notifyEP7QObjectP6QEvent + 1060
    	41  QtGui.so                            0x0000000104bfa537 _ZN19QApplicationWrapper6notifyEP7QObjectP6QEvent + 279
    	42  QtCore                              0x000000010480d1cc _ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent + 124
    	43  QtGui                               0x0000000105a2320c _Z23qt_sendSpontaneousEventP7QObjectP6QEvent + 44
    	44  QtGui                               0x00000001059dba6c _ZN26QEventDispatcherMacPrivate13activateTimerEP16__CFRunLoopTimerPv + 188
    	45  CoreFoundation                      0x00007fff92396b44 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    	46  CoreFoundation                      0x00007fff923967d3 __CFRunLoopDoTimer + 1059
    	47  CoreFoundation                      0x00007fff92409d9d __CFRunLoopDoTimers + 301
    	48  CoreFoundation                      0x00007fff92353268 __CFRunLoopRun + 2024
    	49  CoreFoundation                      0x00007fff92352838 CFRunLoopRunSpecific + 296
    	50  HIToolbox                           0x00007fff92a6843f RunCurrentEventLoopInMode + 235
    	51  HIToolbox                           0x00007fff92a681ba ReceiveNextEventCommon + 431
    	52  HIToolbox                           0x00007fff92a67ffb _BlockUntilNextEventMatchingListInModeWithFilter + 71
    	53  AppKit                              0x00007fff8a75e6d1 _DPSNextEvent + 964
    	54  AppKit                              0x00007fff8a75de80 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
    	55  AppKit                              0x00007fff8a751e23 -[NSApplication run] + 594
    	56  QtGui                               0x00000001059dd3b8 _ZN19QEventDispatcherMac13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 1752
    	57  QtCore                              0x000000010480c0e4 _ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE + 68
    	58  QtCore                              0x000000010480c494 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 324
    	59  QtCore                              0x000000010480eb7c _ZN16QCoreApplication4execEv + 188
    	60  QtGui.so                            0x0000000104bf929c Sbk_QApplicationFunc_exec_ + 92
    	61  libpython3.4m.dylib                 0x00000001000e5855 PyEval_EvalFrameEx + 31413
    	62  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	63  libpython3.4m.dylib                 0x00000001000e55b6 PyEval_EvalFrameEx + 30742
    	64  libpython3.4m.dylib                 0x00000001000e5750 PyEval_EvalFrameEx + 31152
    	65  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	66  libpython3.4m.dylib                 0x00000001000e6adf PyEval_EvalCode + 63
    	67  libpython3.4m.dylib                 0x000000010011165e PyRun_FileExFlags + 206
    	68  libpython3.4m.dylib                 0x0000000100111a0d PyRun_SimpleFileExFlags + 717
    	69  libpython3.4m.dylib                 0x0000000100128e13 Py_Main + 3219
    	70  python3                             0x0000000100000e92 main + 418
    	71  python3                             0x0000000100000cc4 start + 52
    )
    Quelqu'un a-t-il une idée? Est-ce un problème lié à Pyzo? au Mac? ou bien à moi?

    Merci

    Bonne soirée

  2. #2
    Invité
    Invité(e)
    Par défaut
    Citation Envoyé par Leila_A Voir le message
    Bonsoir,
    (snip)(snip)
    Voici ce que j'obtiens :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    In [9]: (executing lines 1 to 14 of "<tmp 5>")
    2015-02-09 01:52:32.756 python3[6387:352789] -[QNSApplication _setup:]: unrecognized selector sent to instance 0x1068a14c0
    2015-02-09 01:52:32.760 python3[6387:352789] (
    	0   CoreFoundation                      0x00007fff9244364c __exceptionPreprocess + 172
    	1   libobjc.A.dylib                     0x00007fff928206de objc_exception_throw + 43
    	2   CoreFoundation                      0x00007fff924466bd -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
    	3   CoreFoundation                      0x00007fff9238da84 ___forwarding___ + 1028
    	4   CoreFoundation                      0x00007fff9238d5f8 _CF_forwarding_prep_0 + 120
    	5   libtk8.5.dylib                      0x000000011049f036 TkpInit + 428
    	6   libtk8.5.dylib                      0x00000001104179d2 Initialize + 1704
    	7   _tkinter.so                         0x0000000107461f9d Tcl_AppInit + 77
    	8   _tkinter.so                         0x000000010745ef07 Tkinter_Create + 919
    	9   libpython3.4m.dylib                 0x00000001000e57ea PyEval_EvalFrameEx + 31306
    	10  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	11  libpython3.4m.dylib                 0x000000010003eb2a function_call + 186
    	12  libpython3.4m.dylib                 0x000000010000d738 PyObject_Call + 104
    	13  libpython3.4m.dylib                 0x00000001000288bc method_call + 140
    	14  libpython3.4m.dylib                 0x000000010000d738 PyObject_Call + 104
    	15  libpython3.4m.dylib                 0x000000010007b611 slot_tp_init + 81
    	16  libpython3.4m.dylib                 0x0000000100072da4 type_call + 212
    	17  libpython3.4m.dylib                 0x000000010000d738 PyObject_Call + 104
    	18  libpython3.4m.dylib                 0x00000001000e1ff4 PyEval_EvalFrameEx + 16980
    	19  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	20  libpython3.4m.dylib                 0x00000001000e6adf PyEval_EvalCode + 63
    	21  libpython3.4m.dylib                 0x00000001000db1ee builtin_exec + 206
    	22  libpython3.4m.dylib                 0x00000001000e57ea PyEval_EvalFrameEx + 31306
    	23  libpython3.4m.dylib                 0x00000001000e5750 PyEval_EvalFrameEx + 31152
    	24  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	25  libpython3.4m.dylib                 0x00000001000e55b6 PyEval_EvalFrameEx + 30742
    	26  libpython3.4m.dylib                 0x00000001000e5750 PyEval_EvalFrameEx + 31152
    	27  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	28  libpython3.4m.dylib                 0x000000010003eb2a function_call + 186
    	29  libpython3.4m.dylib                 0x000000010000d738 PyObject_Call + 104
    	30  libpython3.4m.dylib                 0x00000001000288bc method_call + 140
    	31  libpython3.4m.dylib                 0x000000010000d738 PyObject_Call + 104
    	32  libpython3.4m.dylib                 0x00000001000dc147 PyEval_CallObjectWithKeywords + 87
    	33  libpyside.cpython-34m.1.2.1.dylib   0x00000001046696fa _ZN6PySide13SignalManager20callPythonMetaMethodERK11QMetaMethodPPvP7_objectb + 138
    	34  libpyside.cpython-34m.1.2.1.dylib   0x000000010466fa0c _ZN6PySide16GlobalReceiverV211qt_metacallEN11QMetaObject4CallEiPPv + 172
    	35  QtCore                              0x00000001048258b2 _ZN11QMetaObject8activateEP7QObjectPKS_iPPv + 2146
    	36  QtCore.so                           0x0000000104456f52 _ZN13QTimerWrapper10timerEventEP11QTimerEvent + 146
    	37  QtCore                              0x00000001048214e0 _ZN7QObject5eventEP6QEvent + 432
    	38  QtCore.so                           0x0000000104457483 _ZN13QTimerWrapper5eventEP6QEvent + 307
    	39  QtGui                               0x0000000105a241dd _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent + 189
    	40  QtGui                               0x0000000105a2ac94 _ZN12QApplication6notifyEP7QObjectP6QEvent + 1060
    	41  QtGui.so                            0x0000000104bfa537 _ZN19QApplicationWrapper6notifyEP7QObjectP6QEvent + 279
    	42  QtCore                              0x000000010480d1cc _ZN16QCoreApplication14notifyInternalEP7QObjectP6QEvent + 124
    	43  QtGui                               0x0000000105a2320c _Z23qt_sendSpontaneousEventP7QObjectP6QEvent + 44
    	44  QtGui                               0x00000001059dba6c _ZN26QEventDispatcherMacPrivate13activateTimerEP16__CFRunLoopTimerPv + 188
    	45  CoreFoundation                      0x00007fff92396b44 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
    	46  CoreFoundation                      0x00007fff923967d3 __CFRunLoopDoTimer + 1059
    	47  CoreFoundation                      0x00007fff92409d9d __CFRunLoopDoTimers + 301
    	48  CoreFoundation                      0x00007fff92353268 __CFRunLoopRun + 2024
    	49  CoreFoundation                      0x00007fff92352838 CFRunLoopRunSpecific + 296
    	50  HIToolbox                           0x00007fff92a6843f RunCurrentEventLoopInMode + 235
    	51  HIToolbox                           0x00007fff92a681ba ReceiveNextEventCommon + 431
    	52  HIToolbox                           0x00007fff92a67ffb _BlockUntilNextEventMatchingListInModeWithFilter + 71
    	53  AppKit                              0x00007fff8a75e6d1 _DPSNextEvent + 964
    	54  AppKit                              0x00007fff8a75de80 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 194
    	55  AppKit                              0x00007fff8a751e23 -[NSApplication run] + 594
    	56  QtGui                               0x00000001059dd3b8 _ZN19QEventDispatcherMac13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE + 1752
    	57  QtCore                              0x000000010480c0e4 _ZN10QEventLoop13processEventsE6QFlagsINS_17ProcessEventsFlagEE + 68
    	58  QtCore                              0x000000010480c494 _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE + 324
    	59  QtCore                              0x000000010480eb7c _ZN16QCoreApplication4execEv + 188
    	60  QtGui.so                            0x0000000104bf929c Sbk_QApplicationFunc_exec_ + 92
    	61  libpython3.4m.dylib                 0x00000001000e5855 PyEval_EvalFrameEx + 31413
    	62  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	63  libpython3.4m.dylib                 0x00000001000e55b6 PyEval_EvalFrameEx + 30742
    	64  libpython3.4m.dylib                 0x00000001000e5750 PyEval_EvalFrameEx + 31152
    	65  libpython3.4m.dylib                 0x00000001000e6a1d PyEval_EvalCodeEx + 2349
    	66  libpython3.4m.dylib                 0x00000001000e6adf PyEval_EvalCode + 63
    	67  libpython3.4m.dylib                 0x000000010011165e PyRun_FileExFlags + 206
    	68  libpython3.4m.dylib                 0x0000000100111a0d PyRun_SimpleFileExFlags + 717
    	69  libpython3.4m.dylib                 0x0000000100128e13 Py_Main + 3219
    	70  python3                             0x0000000100000e92 main + 418
    	71  python3                             0x0000000100000cc4 start + 52
    )
    Quelqu'un a-t-il une idée? Est-ce un problème lié à Pyzo? au Mac? ou bien à moi?

    Merci

    Bonne soirée
    Bonsoir Leila,

    À première vue, je dirais que nous avons là un joli core dump (plantage de Pyzo installé sur ta machine).

    Pourquoi ne pas essayer avec -seulement- Python3 ?

    Regarde ici : https://www.python.org/downloads/release/python-342/

    Désinstalle tout d'abord Pyzo, puis installe simplement le Python3 officiel, lance l'éditeur IDLE qui est fourni avec l'installation officielle, puis réessaye le code dans un fichier test.py, ça devrait marcher.

    @+

  3. #3
    Candidat au Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Février 2015
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 29
    Localisation : France, Haute Vienne (Limousin)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2015
    Messages : 3
    Par défaut
    Bonsoir! Merci de ta réponse. Je vais essayer ça alors.

    J'utilise Pyzo car ça nous est demandé pour le concours (A BIO). Enfin ce n'est pas obligatoire, mais fortement conseillé !

    Je te tiens au jus dans l'heure.

    À tout'

  4. #4
    Candidat au Club
    Femme Profil pro
    Étudiant
    Inscrit en
    Février 2015
    Messages
    3
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 29
    Localisation : France, Haute Vienne (Limousin)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2015
    Messages : 3
    Par défaut
    Citation Envoyé par tarball69 Voir le message

    Désinstalle tout d'abord Pyzo, puis installe simplement le Python3 officiel, lance l'éditeur IDLE qui est fourni avec l'installation officielle, puis réessaye le code dans un fichier test.py, ça devrait marcher.

    @+
    Coucou, effectivement ça marche !
    Merci beaucoup, je vais continuer comme ça alors.
    Salut

  5. #5
    Invité
    Invité(e)
    Par défaut
    Tant mieux

    Il faut cliquer sur le bouton en bas de cette page pour marquer la discussion comme telle.

    @+.

Discussions similaires

  1. Ouverture d'une seconde fenêtre avec passage de variable
    Par kawther dans le forum Interfaces Graphiques
    Réponses: 7
    Dernier message: 06/11/2012, 08h50
  2. Ouverture d'une autre fenêtre par un clic sur un menu
    Par helabah dans le forum Interfaces Graphiques en Java
    Réponses: 6
    Dernier message: 29/05/2012, 14h40
  3. IBM Rational Robot : Tester une simple fenêtre Web
    Par shinkyo dans le forum Outils
    Réponses: 2
    Dernier message: 18/12/2008, 17h44
  4. ouverture d'une nouvelle fenêtre
    Par minie dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 15/05/2007, 13h37
  5. [MFC]Ouverture d'une base de donnee avec DAO
    Par Wyatt dans le forum MFC
    Réponses: 7
    Dernier message: 24/01/2005, 10h06

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo