Foros del Web » Programando para Internet » Python »

Ayuda en python

Estas en el tema de Ayuda en python en el foro de Python en Foros del Web. Da error al correr este programa.... Gracias... #*********************************************** # Server TCP/IP #*********************************************** #!/usr/bin/env python import gtk import pygtk class mundo: def __init__(self): # funcion b ...
  #1 (permalink)  
Antiguo 10/10/2010, 18:36
 
Fecha de Ingreso: octubre-2010
Mensajes: 1
Antigüedad: 13 años, 6 meses
Puntos: 0
Ayuda en python

Da error al correr este programa.... Gracias...
#***********************************************
# Server TCP/IP
#***********************************************
#!/usr/bin/env python
import gtk
import pygtk
class mundo:
def __init__(self): # funcion
b = gtk.Builder() # Genera las ventanas
b.add_from_file("mundo.xml")
self.ventanaprincipal = b.get_object("ventana") # Variable
self.boton = b.get_object("boton") # Variable
self.ventanamensaje = b.get_object("Ventana1") # Variable
b.connect_signals(self)
self.ventanaprincipal.show()
def on_boton_clicked(self, widget, data=None):
self.ventanamensaje.show()
def on_ventanaprincipal_destroy(self, widget, data=None):
gtk.main_quit()
mundo()
gtk.main()

mundo.py:14: runtimewarning: missing hardler 'on_ventana.png_activate_default'
b.connect_signals(self)
traceback (most recent call last):
File 'mundo.py', line 20, in <module>
mundo()
File mundo.py, line 15, in__init__
self.ventanaprincipal.show()
attributeerror: 'NoneType' object has no attribute 'shlow'

agradezco a quien pueda ayudar. [email protected]
  #2 (permalink)  
Antiguo 10/10/2010, 18:53
Avatar de razpeitia
Moderador
 
Fecha de Ingreso: marzo-2005
Ubicación: Monterrey, México
Mensajes: 7.321
Antigüedad: 19 años, 1 mes
Puntos: 1360
Respuesta: Ayuda en python

Código Python:
Ver original
  1. self.ventanaprincipal = b.get_object("ventana") # Variable
  2. if self.ventanaprincipal is None:
  3.     print "Objeto ventana no existe"
Esto regreso None y significa que no encontró el objeto ventana.
Ademas en el error que pones dice que llamaste a shlow pero en el código que pones viene como show

Por cierto no pongas tu correo por que nadie te contestara a tu correo, esto es un foro no una lista de correo.

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:21.