jonay

error tk

Sep 26th, 2014
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. Microsoft Windows [Versión 6.1.7601]
  2. Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.
  3.  
  4. C:\Users\Administrador>cd \
  5.  
  6. C:\>tk.py
  7. Exception in Tkinter callback
  8. Traceback (most recent call last):
  9.   File "C:\Python34\lib\tkinter\__init__.py", line 1482, in __call__
  10.     return self.func(*args)
  11.   File "C:\tk.py", line 5, in xd
  12.     ventana.webbrowser.open_new_tab("www.google.es")
  13.   File "C:\Python34\lib\tkinter\__init__.py", line 1878, in __getattr__
  14.     return getattr(self.tk, attr)
  15. AttributeError: 'tkapp' object has no attribute 'webbrowser'
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. from tkinter import *
  28. import webbrowser
  29.  
  30. def xd():
  31.   ventana.webbrowser.open_new_tab("www.google.es")
  32.  
  33.  
  34. ventana = Tk()
  35.  
  36. ventana.title ("navegador")
  37.  
  38. botones = Button(ventana,text="google",command=xd)
  39. botones.pack()
  40.  
  41.  
  42.  
  43.  
  44. ventana.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment