Using chilkat.SYSTEMTIME in Python

Demonstrates how to create and populate a chilkat.
SYSTEMTIME object in Python.

import sys
import chilkat

email = chilkat.CkEmail()

sysTime = chilkat.SYSTEMTIME();

# The SYSTEMTIME structure has the following members:
#    wYear (such as 2011)
#    wMonth (1 = January, 12 = December)
#    wDayOfWeek (0 to 6, where 0 = Sunday 1 = Monday, ... 6 = Sunday)
#               wDayOfWeek may be left at 0 if the other values are set.
#    wDay (1 to 31)
#    wHour (0 to 23)
#    wMinute (0 to 59)
#    wSecond (0 to 59)
#    wMilliseconds (0 to 999)

# Set the date to 15-April-2011  2:15:00pm
sysTime.wYear = 2011;
sysTime.wMonth = 4;
sysTime.wDay = 15;
sysTime.wHour = 14;
sysTime.wMinute = 15;
sysTime.wSecond = 0;

# Pass the SYSTEMTIME object to a method:
email.put_LocalDate(sysTime);

success = email.SaveEml("out.eml")

(Python) Using strings returned from sqlite3

In  the Python programming language, the strings returned from sqlite3 are unicode, not 8-bit strings.

Chilkat API methods with string arguments expect either ANSI or utf-8 8-bit strings.  See these Python examples:

http://www.example-code.com/python/python-source-file-encoding.asp

http://www.example-code.com/python/python-charset.asp

A unicode string returned from sqlite3 must be converted to an 8-bit string by using “str”, as shown below:

...
email.put_Subject(str(unicodeStr))
...

Chilkat v9.1.0 for Linux – Python 2.5, 2.6 ready for Beta testing

Download

64-bit Python 2.5: chilkat-9.1.0-Python-2.5-x86_64-linux.tar.gz

64-bit Python 2.6: chilkat-9.1.0-Python-2.6-x86_64-linux.tar.gz

32-bit Python 2.5: chilkat-9.1.0-Python-2.5-i686-linux.tar.gz

32-bit Python 2.6: chilkat-9.1.0-Python-2.6-i686-linux.tar.gz

Install Instructions

Login as root and decompress and unpackfrom the root (“/”) directory.

su
cd /
gzip -dc
chilkat-9.1.0-python-2.5-linux-x86_64.tar.gz | tar -xof -

That’s all.  However, please read the information below to find out where the files are unpacked. If your Python install prefix is different (sys.prefix) you may need to copy the files to the correct directory matching your install prefix.

Unpack Directories
The x86_64 distribution for Python 2.5 unpacks to:

/usr/lib/python2.5/site-packages/_chilkat.so
/usr/lib/python2.5/site-packages/chilkat.py
/usr/lib/python2.5/site-packages/chilkat.pyc
/usr/lib/python2.5/site-packages/chilkat-9.1.0.egg-info

The i686 distribution for Python 2.5 unpacks to:

/usr/local/lib/python2.5/site-packages/_chilkat.so
/usr/local/lib/python2.5/site-packages/chilkat.py
/usr/local/lib/python2.5/site-packages/chilkat.pyc
/usr/local/lib/python2.5/site-packages/chilkat-9.1.0.egg-info

The i686 and x86_64 distributions for Python 2.6 unpack to:

/usr/local/lib/python2.6/site-packages/_chilkat.so
/usr/local/lib/python2.6/site-packages/chilkat.py
/usr/local/lib/python2.6/site-packages/chilkat.pyc
/usr/local/lib/python2.6/site-packages/chilkat-9.1.0.egg-info

Examples

Online examples are located at http://www.example-code.com/python/default.asp