inkedmn
03-11-2002, 11:39 AM
there's only one problem (that i can see). this script goes out and checks to see if i have any new mail, and if i do, it opens a small box with two buttons: Quit, or Open Mail Client (which will download the new mail). whenever i run the script, my mail client is automatically opened before the window even appears.
i'm sure this is painfully easy and i'm just overlooking it, but if somebody could give me a hand...
import poplib, os
from Tkinter import *
def drawAlert():
root = Tk()
cmd = r'start C:\\progra~1\\thebat~1\\thebat.exe'
widget = Label(root)
widget.config(text='You have new mail')
widget.pack(side=TOP, expand=YES)
widget = Button(None, text='Quit', command=sys.exit)
widget.pack()
widget1 = Button(None, text='Open Mail Client', command=os.system(cmd))
widget1.pack()
root.title('Mail Alert')
root.mainloop()
pop = poplib.POP3('pop.gmx.net')
pop.user('inkedmn@gmx.net')
pop.pass_('<password>')
msg_count = len(pop.list()[1])
if msg_count > 0:
drawAlert()
else:
sys.exit()
oh, and btw, i'm using windows right now in case anybody couldn't tell :)
t.i.a.
i'm sure this is painfully easy and i'm just overlooking it, but if somebody could give me a hand...
import poplib, os
from Tkinter import *
def drawAlert():
root = Tk()
cmd = r'start C:\\progra~1\\thebat~1\\thebat.exe'
widget = Label(root)
widget.config(text='You have new mail')
widget.pack(side=TOP, expand=YES)
widget = Button(None, text='Quit', command=sys.exit)
widget.pack()
widget1 = Button(None, text='Open Mail Client', command=os.system(cmd))
widget1.pack()
root.title('Mail Alert')
root.mainloop()
pop = poplib.POP3('pop.gmx.net')
pop.user('inkedmn@gmx.net')
pop.pass_('<password>')
msg_count = len(pop.list()[1])
if msg_count > 0:
drawAlert()
else:
sys.exit()
oh, and btw, i'm using windows right now in case anybody couldn't tell :)
t.i.a.