01b-Introduction To XML and Python Programming PDF
01b-Introduction To XML and Python Programming PDF
• What is XML?
• What is Python?
Tags
XML is Everywhere
• XML is the most common tool for data transmissions between all sorts of applications
3 © 2011 ANSYS, Inc. December 3, 2012
What is XML? (2)
The Difference Between XML and HTML
• XML is not a replacement for HTML
• XML and HTML were designed with different goals:
• XML was designed to transport and store data, with focus on what data is
• HTML was designed to display data, with focus on how data looks
• HTML is about displaying information, while XML is about carrying
information
XML Does Not DO Anything
• XML was created to structure, store, and transport information
• It is just information wrapped in tags
• Intended software interprets the information from the tags
– Examples
• “extension” tag is used by ACT to interpret the following data as an
extension
• “toolbar” tag is used to define a toolbar and uses the “entry” tag to
create toolbar items
7 © 2011 ANSYS, Inc. December 3, 2012 ! Using a good editor helps a lot!
Variables and Syntax (2)
List
• The most versatile datatype in Python
• Comma-separated values between square
brackets
Operators
• Arithmetic operators: +, -, /, *,…
• Comparison Operators: ==, !=, >=,…
• Assignment operators: =, +=, -=, ...
• Logical operators: and, or, not
Flow Controls
• If-Else
• For
• While
Functions
• begin with the keyword def
• followed by the function name and parentheses
8 © 2011 ANSYS, Inc. December 3, 2012
Recommended References
Free materials
• http://www.python.org/
– Python download all formats
– Tutorial and documentation
• http://ironpython.codeplex.com/
– IronPython studio is free Microsoft SDK that allows you to manage your projects
and develop using native windows forms
• http://www.tutorialspoint.com/python/index.htm
• Free book - http://greenteapress.com/thinkpython/thinkCSpy.pdf
Recommended books
• Learning Python by Mark Lutz and David Ascher
• Python Pocket Reference by Mark Lutz
• IronPython in Action by Michael J.Ford and Christian Muirhead
– For people wanting to use Iron python to take advantage of the .NET framework