Python Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Python Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
Socket / SSL
SFTP
SMTP
Spider
SSH Key
SSH
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

 

(Python) XML Parsing Example: Currency Data

Simple example showing how to parse an XML file containing currency data.

 Chilkat Python Module Downloads for Windows, Linux, and MAC OS X

import sys
import chilkat


xml = chilkat.CkXml()

#  The Chilkat XML component is freeware.

#  Load an XML document.
#  This file is available at http://www.chilkatsoft.com/testData/currency.xml

success = xml.LoadXmlFile("c:/myXmlFiles/currency.xml")
if (success != True):
    print xml.lastErrorText()
    sys.exit()

#  Iterate over each "CURRENCY" child node and display the contents:

n = xml.NumChildrenHavingTag("CURRENCY")
for i in range(0,n):
    # curr is a CkXml
    curr = xml.GetNthChildWithTag("CURRENCY",i)
    print "----"
    print "Name: " + curr.getChildContent("NAME")
    print "Code: " + curr.getChildContent("CURRENCYCODE")
    print "Country: " + curr.getChildContent("COUNTRY")


 

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.