Python - Al ejecutar aplicacion para a exe con py2exe no hace nada

 
Vista:

Al ejecutar aplicacion para a exe con py2exe no hace nada

Publicado por nico (2 intervenciones) el 30/04/2014 17:13:10
Hola gente, les hago una consulta. Me baje Python 2.7 , Glade 3.8.3, instale el paquete "all in one" pygtk, luego me instale py2exe para generar un ejecutable.

Me hice un programa que GUI el cual funciona correctamente cuando ejecuto el script python. Pero si compilo con py2exe, me genera el ejecutable, pero al ejecutarlo, no pasa nada. Alguna idea porque puede ser?

Muchas Gracias
Saludos!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de xve
Val: 2.239
Plata
Ha mantenido su posición en Python (en relación al último mes)
Gráfica de Python

Al ejecutar aplicacion para a exe con py2exe no hace nada

Publicado por xve (1646 intervenciones) el 30/04/2014 20:47:01
Hola Nico, la verdad es que yo únicamente utilice un vez el py3exe para pruebas, y no tuve ningún problema...

Nos puedes mostrar el código para probarlo?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Al ejecutar aplicacion para a exe con py2exe no hace nada

Publicado por nico (2 intervenciones) el 30/04/2014 20:49:28
Hola xve, este es el codigo:

Python:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python
 
import gtk
 
class  QueryRelevanceEvaluationApp:
 
    def __init__(self):
        filename = "xml.glade"
        builder = gtk.Builder()
        builder.add_from_file(filename)
        builder.connect_signals(self)
 
    def on_buttonGenerate_clicked(self, widget):
        print "You clicked the button"
 
app = QueryRelevanceEvaluationApp()
gtk.main()

XML de Glade:
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
<?xml version="1.0"?>
<interface>
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkWindow" id="windowRelevanceEvaluation">
<property name="visible">True</property>
<property name="title" translatable="yes">Query Result Relevance Evaluation</property>
<child>
  <object class="GtkVBox" id="vbox1">
    <property name="visible">True</property>
    <property name="orientation">vertical</property>
    <child>
      <object class="GtkHBox" id="hbox2">
        <property name="visible">True</property>
        <child>
          <object class="GtkLabel" id="labelQuery">
            <property name="visible">True</property>
            <property name="label" translatable="yes">Query:</property>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="padding">4</property>
            <property name="position">0</property>
          </packing>
        </child>
        <child>
          <object class="GtkEntry" id="entry1">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="invisible_char">&#x25CF;</property>
          </object>
          <packing>
            <property name="padding">4</property>
            <property name="position">1</property>
          </packing>
        </child>
      </object>
      <packing>
        <property name="position">0</property>
      </packing>
    </child>
    <child>
      <object class="GtkFrame" id="frameSource">
        <property name="visible">True</property>
        <property name="label_xalign">0</property>
        <child>
          <object class="GtkAlignment" id="alignment1">
            <property name="visible">True</property>
            <property name="left_padding">12</property>
            <child>
              <object class="GtkHButtonBox" id="hbuttonbox1">
                <property name="visible">True</property>
                <child>
                  <object class="GtkRadioButton" id="radiobuttonGoogle">
                    <property name="label" translatable="yes">Google</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">False</property>
                    <property name="active">True</property>
                    <property name="draw_indicator">True</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">False</property>
                    <property name="position">0</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkRadioButton" id="radiobuttonBing">
                    <property name="label" translatable="yes">Bing</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">False</property>
                    <property name="active">True</property>
                    <property name="draw_indicator">True</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">False</property>
                    <property name="position">1</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkRadioButton" id="radiobuttonBoden">
                    <property name="label" translatable="yes">Boden</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">False</property>
                    <property name="active">True</property>
                    <property name="draw_indicator">True</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">False</property>
                    <property name="position">2</property>
                  </packing>
                </child>
                <child>
                  <object class="GtkRadioButton" id="radiobuttonCSV">
                    <property name="label" translatable="yes">CSV</property>
                    <property name="visible">True</property>
                    <property name="can_focus">True</property>
                    <property name="receives_default">False</property>
                    <property name="active">True</property>
                    <property name="draw_indicator">True</property>
                  </object>
                  <packing>
                    <property name="expand">False</property>
                    <property name="fill">False</property>
                    <property name="position">3</property>
                  </packing>
                </child>
              </object>
            </child>
          </object>
        </child>
        <child type="label">
          <object class="GtkLabel" id="labelFrameSource">
            <property name="visible">True</property>
            <property name="label"    translatable="yes">&lt;b&gt;Source&lt;/b&gt;</property>
            <property name="use_markup">True</property>
          </object>
        </child>
      </object>
      <packing>
        <property name="position">1</property>
      </packing>
    </child>
    <child>
      <object class="GtkFrame" id="frame1">
        <property name="visible">True</property>
        <property name="label_xalign">0</property>
        <child>
          <object class="GtkHBox" id="hbox3">
            <property name="visible">True</property>
            <child>
              <object class="GtkLabel" id="labelResults">
                <property name="visible">True</property>
                <property name="label" translatable="yes">Number Results:</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkSpinButton" id="spinbuttonResults">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="invisible_char">&#x25CF;</property>
              </object>
              <packing>
                <property name="padding">4</property>
                <property name="position">1</property>
              </packing>
            </child>
          </object>
        </child>
        <child type="label">
          <object class="GtkLabel" id="labelFrameResults">
            <property name="visible">True</property>
            <property name="label" translatable="yes">&lt;b&gt;Results&lt;/b&gt;</property>
            <property name="use_markup">True</property>
          </object>
        </child>
      </object>
      <packing>
        <property name="padding">2</property>
        <property name="position">2</property>
      </packing>
    </child>
    <child>
      <object class="GtkButton" id="buttonGenerateResults">
        <property name="label" translatable="yes">Generate!</property>
        <property name="visible">True</property>
        <property name="can_focus">True</property>
        <property name="receives_default">True</property>
      </object>
      <packing>
        <property name="position">3</property>
      </packing>
    </child>
  </object>
</child>
</object>
</interface>

Por ultimo, el script de Python que uso para compilar:

1
2
3
4
5
6
7
8
9
10
11
12
from distutils.core import setup
import py2exe
setup(name="Aplicacion de ejemplo",
	version="0.1",
	description="Ejemplo del funcionamiento de distutils",
	author="Raul Gonzalez",
	author_email="zootropo en gmail",
	url="http://mundogeek.net/tutorial-python/",
	license="GPL",
	scripts=["main.py"],
	console=["main.py"]
	)
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar