Run as service

  • Thread starter =?ISO-8859-1?Q?Andr=E9_Nobre?=
  • Start date
?

=?ISO-8859-1?Q?Andr=E9_Nobre?=

Hello,
i´m starting with python and i made this little piece of code, to know
if i have new mails to receive.

import poplib, getpass
arquivo = 'mails.txt'
info = file(arquivo).read().split('\n')
d = {}
for e in info:
a = e.split('\t')
print "Verificando e-mail de %s" % (a[1],)
p = poplib.POP3(a[0])
p.user(a[1])
p.pass_(getpass.getpass())
print "\n%s mensagens em seu mailbox.\n" % p.stat()[0]
p = None
print "Final"


it gets some information from mails.txt* file and watch new mails. I
want to know how to leave this code running as service under windows and
send a warning message (like that windows popup messages) when a there
is a new e-mail.

* my file is like this (simple text)
mailserver \t maillogin \n

Tkz and sorry about my english....
 
L

Larry Bates

You should probably get your hands on Mark Hammond's,
excellent book, Python Programming on Win32. It
has a very good section on writing services. I'm not
sure you want this to run as a service.

Also take a look at Sam Rushing's site. There is an
example of a POP3 mailbox system-tray app. Should
be a good example to work from. It may already to
what you want.

HTH,
Larry Bates
Syscon, Inc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top