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

wxPython Discussion :

Fermeture application mais process toujours la


Sujet :

wxPython

  1. #1
    Membre du Club
    Inscrit en
    Juillet 2005
    Messages
    71
    Détails du profil
    Informations personnelles :
    Âge : 43

    Informations forums :
    Inscription : Juillet 2005
    Messages : 71
    Points : 53
    Points
    53
    Par défaut Fermeture application mais process toujours la
    Bonsoir,

    J'ai une application python avec GUI wxpython qui parait plutot bien fonctionner.

    Mais je veux la distribuer pour les utilisateurs de windows et linux. Donc je passe par py2exe pour faire un .exe

    Et si j'exécute mon fichier exe, à la fermeture de l'application, le processus lié à mon application est toujours actif dans le gestionnaire de processus windows.

    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
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    # generated by wxGlade 0.6.3 on Sat May 17 16:26:08 2008
    #
    #   This file is part of AstuGeClim.
    #
    #    AstuGeClim is free software; you can redistribute it and/or modify
    #    it under the terms of the GNU General Public License as published by
    #    the Free Software Foundation; either version 2 of the License, or
    #    (at your option) any later version.
    #
    #    AstuGeClim is distributed in the hope that it will be useful,
    #    but WITHOUT ANY WARRANTY; without even the implied warranty of
    #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    #    GNU General Public License for more details.
    #
    #    You should have received a copy of the GNU General Public License
    #    along with emesene; if not, write to the Free Software
    #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     
    import wx
    import psyco
    from gui_a_propos import *
    from gui_pas_developpee import *
    from gui_app_dah import *
    from gui_ventil_lt_froid import *
     
    # begin wxGlade: extracode
    # end wxGlade
     
    class MyFrame_astugeclim(wx.Frame):
        def __init__(self, *args, **kwds):
            # begin wxGlade: MyFrame_astugeclim.__init__
            kwds["style"] = wx.DEFAULT_FRAME_STYLE
            wx.Frame.__init__(self, *args, **kwds)
     
            # Menu Bar
            self.frame_astugeclim_menubar = wx.MenuBar()
            wxglade_tmp_menu = wx.Menu()
            self.frame_astugeclim_menubar.Append(wxglade_tmp_menu, "Fichier")
            wxglade_tmp_menu = wx.Menu()
            self.frame_astugeclim_menubar.Append(wxglade_tmp_menu, "?")
            self.SetMenuBar(self.frame_astugeclim_menubar)
            # Menu Bar end
            self.b_dah = wx.BitmapButton(self, -1, wx.Bitmap("images/dah.png", wx.BITMAP_TYPE_ANY))
            self.label_2 = wx.StaticText(self, -1, u"Données du DAH")
            self.b_acoustique = wx.BitmapButton(self, -1, wx.Bitmap("images/acoustique.png", wx.BITMAP_TYPE_ANY))
            self.label_8 = wx.StaticText(self, -1, "Acoustique")
            self.label_19 = wx.StaticText(self, -1, "")
            self.label_13 = wx.StaticText(self, -1, "")
            self.bitmap_button_1 = wx.BitmapButton(self, -1, wx.Bitmap("images/katuberling.png", wx.BITMAP_TYPE_ANY))
            self.label_3 = wx.StaticText(self, -1, "BCP")
            self.bitmap_button_5 = wx.BitmapButton(self, -1, wx.Bitmap("images/katuberling.png", wx.BITMAP_TYPE_ANY))
            self.label_9 = wx.StaticText(self, -1, "Dimensionnement CTA")
            self.label_20 = wx.StaticText(self, -1, "")
            self.label_14 = wx.StaticText(self, -1, "")
            self.bitmap_button_2 = wx.BitmapButton(self, -1, wx.Bitmap("images/katuberling.png", wx.BITMAP_TYPE_ANY))
            self.label_4 = wx.StaticText(self, -1, "Vase d'expansion")
            self.bitmap_button_6 = wx.BitmapButton(self, -1, wx.Bitmap("images/katuberling.png", wx.BITMAP_TYPE_ANY))
            self.label_10 = wx.StaticText(self, -1, "Pdc hydraulique")
            self.label_21 = wx.StaticText(self, -1, "")
            self.label_15 = wx.StaticText(self, -1, "")
            self.bitmap_button_3 = wx.BitmapButton(self, -1, wx.Bitmap("images/katuberling.png", wx.BITMAP_TYPE_ANY))
            self.label_5 = wx.StaticText(self, -1, "Socle de pompe")
            self.bitmap_button_7 = wx.BitmapButton(self, -1, wx.Bitmap("images/katuberling.png", wx.BITMAP_TYPE_ANY))
            self.label_11 = wx.StaticText(self, -1, u"PDC aéraulique")
            self.label_22 = wx.StaticText(self, -1, "")
            self.label_16 = wx.StaticText(self, -1, "")
            self.bitmap_button_4 = wx.BitmapButton(self, -1, wx.Bitmap("images/katuberling.png", wx.BITMAP_TYPE_ANY))
            self.label_6 = wx.StaticText(self, -1, "Siphon de condensats")
            self.b_ventil_lt_froid = wx.BitmapButton(self, -1, wx.Bitmap("images/ventil_lt_froid.gif", wx.BITMAP_TYPE_ANY))
            self.label_12 = wx.StaticText(self, -1, "Ventilation LT froid")
            self.label_23 = wx.StaticText(self, -1, "")
            self.label_17 = wx.StaticText(self, -1, "")
            self.b_quitter = wx.BitmapButton(self, -1, wx.Bitmap("images/exit.png", wx.BITMAP_TYPE_ANY))
            self.label_7 = wx.StaticText(self, -1, "")
            self.b_help = wx.BitmapButton(self, -1, wx.Bitmap("images/help.png", wx.BITMAP_TYPE_ANY))
            self.label_18 = wx.StaticText(self, -1, "")
            self.b_info = wx.BitmapButton(self, -1, wx.Bitmap("images/info.gif", wx.BITMAP_TYPE_ANY))
            self.label_1 = wx.StaticText(self, -1, "")
     
            self.__set_properties()
            self.__do_layout()
     
            self.Bind(wx.EVT_BUTTON, self.ouvrir_dah, self.b_dah)
            self.Bind(wx.EVT_BUTTON, self.ouvrir_acoustique, self.b_acoustique)
            self.Bind(wx.EVT_BUTTON, self.ouvrir_bcp, self.bitmap_button_1)
            self.Bind(wx.EVT_BUTTON, self.ouvrir_cta, self.bitmap_button_5)
            self.Bind(wx.EVT_BUTTON, self.ouvrir_ve, self.bitmap_button_2)
            self.Bind(wx.EVT_BUTTON, self.ouvrir_pdc_hydrau, self.bitmap_button_6)
            self.Bind(wx.EVT_BUTTON, self.ouvrir_socle_pompe, self.bitmap_button_3)
            self.Bind(wx.EVT_BUTTON, self.ouvrir_pdc_aerau, self.bitmap_button_7)
            self.Bind(wx.EVT_BUTTON, self.ouvrir_siphon_condensats, self.bitmap_button_4)
            self.Bind(wx.EVT_BUTTON, self.ouvrir_ventil_lt_froid, self.b_ventil_lt_froid)
            self.Bind(wx.EVT_BUTTON, self.quitter_astugeclim, self.b_quitter)
            self.Bind(wx.EVT_BUTTON, self.aide_astugeclim, self.b_help)
            self.Bind(wx.EVT_BUTTON, self.afficher_infos, self.b_info)
            # end wxGlade
     
        def __set_properties(self):
            self.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_2.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_3.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_4.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_5.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_6.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_7.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_8.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_9.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_10.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_11.SetBackgroundColour(wx.Colour(216, 216, 191))
            self.label_12.SetBackgroundColour(wx.Colour(216, 216, 191))
            # begin wxGlade: MyFrame_astugeclim.__set_properties
            self.SetTitle("AstuGeClim")
            self.b_dah.SetSize(self.b_dah.GetBestSize())
            self.b_acoustique.SetSize(self.b_acoustique.GetBestSize())
            self.bitmap_button_1.SetSize(self.bitmap_button_1.GetBestSize())
            self.bitmap_button_5.SetSize(self.bitmap_button_5.GetBestSize())
            self.bitmap_button_2.SetSize(self.bitmap_button_2.GetBestSize())
            self.bitmap_button_6.SetSize(self.bitmap_button_6.GetBestSize())
            self.bitmap_button_3.SetSize(self.bitmap_button_3.GetBestSize())
            self.bitmap_button_7.SetSize(self.bitmap_button_7.GetBestSize())
            self.bitmap_button_4.SetSize(self.bitmap_button_4.GetBestSize())
            self.b_ventil_lt_froid.SetSize(self.b_ventil_lt_froid.GetBestSize())
            self.b_quitter.SetSize(self.b_quitter.GetBestSize())
            self.b_help.SetSize(self.b_help.GetBestSize())
            self.b_info.SetSize(self.b_info.GetBestSize())
            # end wxGlade
     
        def __do_layout(self):
            # begin wxGlade: MyFrame_astugeclim.__do_layout
            grid_sizer_1 = wx.GridSizer(6, 6, 0, 0)
            grid_sizer_1.Add(self.b_dah, 0, 0, 0)
            grid_sizer_1.Add(self.label_2, 0, 0, 0)
            grid_sizer_1.Add(self.b_acoustique, 0, 0, 0)
            grid_sizer_1.Add(self.label_8, 0, 0, 0)
            grid_sizer_1.Add(self.label_19, 0, 0, 0)
            grid_sizer_1.Add(self.label_13, 0, 0, 0)
            grid_sizer_1.Add(self.bitmap_button_1, 0, 0, 0)
            grid_sizer_1.Add(self.label_3, 0, 0, 0)
            grid_sizer_1.Add(self.bitmap_button_5, 0, 0, 0)
            grid_sizer_1.Add(self.label_9, 0, 0, 0)
            grid_sizer_1.Add(self.label_20, 0, 0, 0)
            grid_sizer_1.Add(self.label_14, 0, 0, 0)
            grid_sizer_1.Add(self.bitmap_button_2, 0, 0, 0)
            grid_sizer_1.Add(self.label_4, 0, 0, 0)
            grid_sizer_1.Add(self.bitmap_button_6, 0, 0, 0)
            grid_sizer_1.Add(self.label_10, 0, 0, 0)
            grid_sizer_1.Add(self.label_21, 0, 0, 0)
            grid_sizer_1.Add(self.label_15, 0, 0, 0)
            grid_sizer_1.Add(self.bitmap_button_3, 0, 0, 0)
            grid_sizer_1.Add(self.label_5, 0, 0, 0)
            grid_sizer_1.Add(self.bitmap_button_7, 0, 0, 0)
            grid_sizer_1.Add(self.label_11, 0, 0, 0)
            grid_sizer_1.Add(self.label_22, 0, 0, 0)
            grid_sizer_1.Add(self.label_16, 0, 0, 0)
            grid_sizer_1.Add(self.bitmap_button_4, 0, 0, 0)
            grid_sizer_1.Add(self.label_6, 0, 0, 0)
            grid_sizer_1.Add(self.b_ventil_lt_froid, 0, 0, 0)
            grid_sizer_1.Add(self.label_12, 0, 0, 0)
            grid_sizer_1.Add(self.label_23, 0, 0, 0)
            grid_sizer_1.Add(self.label_17, 0, 0, 0)
            grid_sizer_1.Add(self.b_quitter, 0, 0, 0)
            grid_sizer_1.Add(self.label_7, 0, 0, 0)
            grid_sizer_1.Add(self.b_help, 0, 0, 0)
            grid_sizer_1.Add(self.label_18, 0, 0, 0)
            grid_sizer_1.Add(self.b_info, 0, 0, 0)
            grid_sizer_1.Add(self.label_1, 0, 0, 0)
            self.SetSizer(grid_sizer_1)
            grid_sizer_1.Fit(self)
            self.Layout()
            # end wxGlade
     
        def ouvrir_dah(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `ouvrir_dah' not implemented"
    	frame_01 = MyFrame(None, -1, "")
    	app.SetTopWindow(frame_01)
    	frame_01.Show()
    	app.MainLoop()
            event.Skip()
     
        def ouvrir_acoustique(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `ouvrir_acoustique' not implemented"
    	frame_02 = MyFrame_pas_cree(None, -1, "")
    	app.SetTopWindow(frame_02)
    	frame_02.Show()
    	app.MainLoop()
            event.Skip()
     
        def quitter_astugeclim(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `quitter_astugeclim' not implemented"
    	self.Destroy()
            event.Skip()
     
        def aide_astugeclim(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `aide_astugeclim' not implemented"
    	frame_03 = MyFrame_pas_cree(None, -1, "")
    	app.SetTopWindow(frame_03)
    	frame_03.Show()
    	app.MainLoop()
            event.Skip()
     
        def afficher_infos(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `afficher_infos' not implemented"
            frame_04 = MyFrame_a_propos(None, -1, "")
            app.SetTopWindow(frame_04)
    	frame_04.Show()
    	app.MainLoop()
    	event.Skip()
     
        def ouvrir_bcp(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `ouvrir_bcp' not implemented"
            frame_05 = MyFrame_pas_cree(None, -1, "")
            app.SetTopWindow(frame_05)
    	frame_05.Show()
    	app.MainLoop()
    	event.Skip()
     
        def ouvrir_cta(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `ouvrir_cta' not implemented"
            frame_06 = MyFrame_pas_cree(None, -1, "")
            app.SetTopWindow(frame_06)
    	frame_06.Show()
    	app.MainLoop()
    	event.Skip()
     
        def ouvrir_ve(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `ouvrir_ve' not implemented"
            frame_07 = MyFrame_pas_cree(None, -1, "")
            app.SetTopWindow(frame_07)
    	frame_07.Show()
    	app.MainLoop()
    	event.Skip()
     
        def ouvrir_pdc_hydrau(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `ouvrir_pdc_hydrau' not implemented"
            frame_08 = MyFrame_pas_cree(None, -1, "")
            app.SetTopWindow(frame_08)
    	frame_08.Show()
    	app.MainLoop()
    	event.Skip()
     
        def ouvrir_socle_pompe(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `ouvrir_socle_pompe' not implemented"
            frame_09 = MyFrame_pas_cree(None, -1, "")
            app.SetTopWindow(frame_09)
    	frame_09.Show()
    	app.MainLoop()
    	event.Skip()
     
        def ouvrir_pdc_aerau(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `ouvrir_pdc_aerau' not implemented"
            frame_10 = MyFrame_pas_cree(None, -1, "")
            app.SetTopWindow(frame_10)
    	frame_10.Show()
    	app.MainLoop()
    	event.Skip()
     
        def ouvrir_siphon_condensats(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `ouvrir_siphon_condensats' not implemented"
            frame_11 = MyFrame_pas_cree(None, -1, "")
            app.SetTopWindow(frame_11)
    	frame_11.Show()
    	app.MainLoop()
    	event.Skip()
     
        def ouvrir_ventil_lt_froid(self, event): # wxGlade: MyFrame_astugeclim.<event_handler>
            #print "Event handler `ouvrir_ventil_lt_froid' not implemented"
    	frame_12 = ventil_lt_froid(None, -1, "")
    	app.SetTopWindow(frame_12)
    	frame_12.Show()
    	app.MainLoop()
     
    # end of class MyFrame_astugeclim
     
    if __name__ == "__main__":
    	psyco.full()
    	app = wx.PySimpleApp(0)
    	wx.InitAllImageHandlers()
    	frame_astugeclim = MyFrame_astugeclim(None, -1, "")
    	app.SetTopWindow(frame_astugeclim)
    	frame_astugeclim.Show()
    	app.MainLoop()
    Voilà je vous ai mis le code de la page principale. Si ca peut vous aider.

    Pourtant il me semble fermer l'application comme il faut "self.Destroy()".

    Merci à tous pour un petit coup de main.

  2. #2
    Membre du Club
    Inscrit en
    Juillet 2005
    Messages
    71
    Détails du profil
    Informations personnelles :
    Âge : 43

    Informations forums :
    Inscription : Juillet 2005
    Messages : 71
    Points : 53
    Points
    53
    Par défaut
    hello,

    Alors je me répond à moi même.

    En fait le processus se coupe environ 20 secondes après la fermeture de l'application.

    Ouf.

  3. #3
    Membre habitué
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2007
    Messages
    172
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Janvier 2007
    Messages : 172
    Points : 163
    Points
    163
    Par défaut
    Tu peux utiliser sys.exit() ou os._exit(1), oublies pas les imports

  4. #4
    Membre du Club
    Inscrit en
    Juillet 2005
    Messages
    71
    Détails du profil
    Informations personnelles :
    Âge : 43

    Informations forums :
    Inscription : Juillet 2005
    Messages : 71
    Points : 53
    Points
    53
    Par défaut
    en fait j'ai revu toutes mes interfaces et cela marche au poil.

    Le pb venait d'un problème de développement. Je faisait des fenêtre principales sans arrêt il devait se produire une phénomène de surcharge.

    Donc refonte modifs et sortie d'un truc qui ressemble à de la prog dans les "règles de l'art" enfin mieux qu'avant.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [C#] Process toujours actif apres fermeture de la fenetre
    Par toxycyty dans le forum Windows Forms
    Réponses: 4
    Dernier message: 26/10/2006, 16h48
  2. [VB6] Probleme fermeture application
    Par h82kev dans le forum VB 6 et antérieur
    Réponses: 4
    Dernier message: 04/03/2006, 13h18
  3. [VB]fichier XL reste verrouillé apres fermeture application
    Par abdou.sahraoui dans le forum VB 6 et antérieur
    Réponses: 3
    Dernier message: 27/01/2006, 14h34
  4. Empecher fermeture Application Console.
    Par Oregon09 dans le forum Langage
    Réponses: 8
    Dernier message: 09/01/2006, 20h45
  5. base vide mais champs toujours affichés
    Par trotters213 dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 16/03/2005, 09h08

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