13.07.2015 Views

The wxPython tutorial

The wxPython tutorial

The wxPython tutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>wxPython</strong> griptshttp://www.zetcode.com/wxpython/gripts/import smtplibFrom, To and Subject options must be separated by carriedge return andnewline as shown here. This weird thing is requested by RFC 821 norm. Sowe must follow it.header = 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n' % (sender, recipient, subject)Next we create an SMTP connection. Here you specify your settings. EachISP gives you the name of the pop and smtp servers. In my case,'mail.chello.sk' is a name for both. A mail is sent by calling the sendmail()method. Finally, we quit the connection with the quit() method.server = smtplib.SMTP('mail.chello.sk')server.sendmail(sender, recipient, message)server.quit()EditorThis editor example is the largest so far.Figure: Editor#!/usr/bin/python# Editorimport wximport os3 de 12 27/04/2008 1:09

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!