IDLE GUI not working

2010-12-26 Thread Python Programming
Hello all,

Newbie here so go easy on me.  I've been trying to get the IDLE GUI to
work on my machine, but have been unsuccessful so far.  I have an IBM
Thinkpad running Windows XP and it has an older version of Python
running (2.2, I believe).  When I try to use the shortcut to open the
IDLE GUI nothing happens (not even a process running in task
manager).  When I use the cmd line to try to open the IDLE GUI, I get
this error message:


C:\>C:\python27\python C:\python27\Lib\idlelib\idle.py
Traceback (most recent call last):
  File "C:\python27\Lib\idlelib\idle.py", line 11, in 
idlelib.PyShell.main()
  File "C:\python27\Lib\idlelib\PyShell.py", line 1389, in main
root = Tk(className="Idle")
  File "C:\python27\lib\lib-tk\Tkinter.py", line 1685, in __init__
self.tk = _tkinter.create(screenName, baseName, className,
interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the following
directories:
{C:\IBMTOOLS\Python22\tcl\tcl8.4} C:/IBMTOOLS/Python22/tcl/tcl8.5
C:/python2
7/lib/tcl8.5 C:/lib/tcl8.5 C:/lib/tcl8.5 C:/library C:/library C:/
tcl8.5.2/libra
ry C:/tcl8.5.2/library

C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl: version conflict for package
"Tcl": ha
ve 8.5.2, need exactly 8.4
version conflict for package "Tcl": have 8.5.2, need exactly 8.4
while executing
"package require -exact Tcl 8.4"
(file "C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl" line 19)
invoked from within
"source C:/IBMTOOLS/Python22/tcl/tcl8.4/init.tcl"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list source $tclfile]"


This probably means that Tcl wasn't installed properly.


As I understand this, python 2.7 is looking in a directory or path
specified by the older, python 2.2 for Tcl.  I have tried to unset
this path by entering this into the cmd line:

---
C:\>set TCL_LIBRARY=
C:\>set TK_LIBRARY=
C:\>C:\Python27\python.exe C:\Python27\Lib\idlelib\idle.py
---

No dice.

I tried to enter this information as a new pythonpath in the
environment variables.  No dice.

I've tried, in vain, to get this thing working, but most of the other
explanations are way over my head (I'm pretty new to programming and
digging around the programming guts of computers)

It seems like a fairly common problem, but haven't gotten a good
answer from either the official python help boards or elsewhere.  I
was hoping that someone here could give me a easy to understand way to
make the IDLE GUI work.

Thanks in advance.
-- 
http://mail.python.org/mailman/listinfo/python-list


Newb Tkinter Question: Object has no attribute 'tk'

2006-06-30 Thread python programming newb
Hi all, first post.

I'm new to python and tkinter.  I'm trying to write a program that
opens the root window with a button that then opens a toplevel window
that then has it's own widgets.  I can get the new toplevel window to
open but none of the widgets appear. The console gives me:

AttributeError: 'NewWindow' object has no attribute 'tk'

Here's my code:


from Tkinter import *


class Application(Frame):
"""The full screen window with menu"""
def __init__(self, master):

Frame.__init__(self, master)
self.grid()
self.create_menu()
self.create_widget()

def create_menu(self):
"""Create file and help menu"""
#Create Filemenu
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label = "Exit", command = root.quit)
menubar.add_cascade(label="File", menu=filemenu)
#Create Helpmenu
helpmenu = Menu(menubar, tearoff=0)
helpmenu.add_command(label="About", command=hello)
menubar.add_cascade(label="Help", menu=helpmenu)

def create_widget(self):
"""Make a button in the center that when pushed opens another
window"""
self.bttn1 = Button(self, text = "Push to open new window",
command=NewWindow)
self.bttn1.grid()


class NewWindow(object):

def __init__(self):
self.z = Toplevel()
self.z.geometry("640x480")
self.z.title("This is the New Window")
self.frame = Frame(self.z)
self.create_widgetnew()
self.frame.grid()

def create_widgetnew(self):
self.lbl = Label(self, text = "Here is a label")
self.lbl.grid(row = 0, column = 1, sticky = N)
self.bttn = Button(self, text = "Close", command=self.z.quit)
self.bttn.grid(row = 2, column = 1, sticky = S)

#Main

def hello():
print "hello in the terminal"

root = Tk()
root.title("ROOT WINDOW")
root.geometry("300x200")
menubar = Menu(root)
root.config(menu=menubar)
mainapp=Application(root)
root.mainloop()

-- 
http://mail.python.org/mailman/listinfo/python-list


py2exe socket.gaierror (10093)

2008-03-26 Thread Python Programming on Win32
Hi,

I have encountered a problem which I can not figure out a solution
to.
Tried Googeling it, but to no help unfortunately.

The problem is running smtplib in a py2exe compiled exe file. When it
tries to establish a socket to the mail server it fails.

Just wondering someone has encountered this before, and if someone
might be able to point me in the right direction.

Unhandled exception in thread started by
Traceback (most recent call last):
  File "AutomationThread.pyc", line 152, in Run
  File "mail.pyc", line 11, in sendMail
  File "smtplib.pyc", line 244, in __init__
  File "smtplib.pyc", line 296, in connect
socket.gaierror: (10093, 'getaddrinfo failed')


Thank you !
-- 
http://mail.python.org/mailman/listinfo/python-list