Re: How to send an email with GMail in Python from Windows

2009-03-12 Thread gordyt
Howdy Avinash, Here is a simple example for you. from smtplib import SMTP HOST = "smtp.gmail.com" PORT = 587 ACCOUNT = ""# put your gmail email account here PASSWORD = "" # put your gmail email password here def send_email(to_addrs, subject, msg): server = SMTP(HOST,PORT) s

Re: SQLite

2008-10-03 Thread gordyt
Howdy Matthias! The delete operation will set the rowcount member of your cursor. Let's assume you have an sqlite3 database with a table called 'test' with an id column. It does have a record with id=1. It does not have a record with id=2. >>> import sqlite3 >>> connection = sqlite3.connect('te

Re: Sending e-mail

2008-08-28 Thread gordyt
Peter here is an example. I just tried it and it works fine. from smtplib import SMTP HOST = "smtp.gmail.com" PORT = 587 ACCOUNT = "" # put your gmail email account name here PASSWORD = "" # put your gmail email account password here def send_email(to_addrs, subject, msg): server = SMTP(HO

Re: Python and database unittests

2008-08-26 Thread gordyt
Daniel I don't know if it would work for your situation or not, but if you are using Python 2.5, you could use the now built-in sqlite3 module. If you didn't even want to create a temporary database file you could use the special memory-only syntax like this: >>> import sqlite3 >>> conn =sqlite3.

Re: datetime from uuid1 timestamp

2008-08-13 Thread gordyt
Howdy Kent, Interesting question! Give this a shot: import datetime import time import uuid # get offset in seconds between the UUID timestamp Epoch (1582-10-15) and # the Epoch used on this computer DTD_SECS_DELTA = (datetime.datetime(*time.gmtime(0)[0:3])- datetime.datetime(1582, 10, 15)).day

Re: ISO books of official Python docs

2008-01-09 Thread gordyt
Howdy kynnjo, > Is it possible to buy the official Python docs in book form? If > so, I'd very much appreciate the name(s) and author(s) of the > book(s). I haven't seen them in print form, but you can download PDF's from here: http://docs.python.org/download.html --gordy -- http://mail.pytho

Re: Python for web...

2007-12-25 Thread gordyt
Howdy Thushanthan, Here is one that is hot off the press: The Definitive Guide to Django: Web Development Done Right http://www.apress.com/book/view/1590597257 --gordon -- http://mail.python.org/mailman/listinfo/python-list

Re: import vs. subdirectory search

2007-01-18 Thread gordyt
John try this: from M2Crypto import SSL That should put your SSL module in the namespace as you want. --gordy -- http://mail.python.org/mailman/listinfo/python-list

Re: converting mysql db into sqlite3.

2006-12-16 Thread gordyt
You could probably use the mysqldump command with the proper options to export the contents of your mysql database to an ASCII text file that contains the SQL insert statements. Then you could import that information to a sqlite database file. You may have to massage the export file if it contain