Thông tin tài liệu
Copyright 2001, ActiveState Python and XML Copyright 2001, ActiveState About me • Paul Prescod, (paul@activestate.com) • ActiveState Senior Developer • Co-Author, XML Handbook Copyright 2001, ActiveState Preview • About Python • Python SAX/DOM • PyXML Package • Python XSLT/XPath • Python SOAP/XML-RPC • XML and Zope Copyright 2001, ActiveState What is Python? • Python is an easy to learn, powerful programming language. – Efficient high-level data structures – Simple approach to object-oriented programming. – Elegant syntax and dynamic typing Copyright 2001, ActiveState Brief History of Python • CWI, early 90s. • Dynamic Object Oriented High Level Language. • More than a text processing language. • More than a scripting language. • Scalable and object oriented from the beginning. • Dynamically type checked. Copyright 2001, ActiveState Python's business case • Python can displace many other languages in the organization. • The Python interpreter is free. • Python is legally unencumbered. • Professional programmers find Python more flexible than most languages. • Amateur programmers are (often) more comfortable than with Perl or Java. Copyright 2001, ActiveState Usability features • Exceptionally clear syntax. • Provides an obvious way to do most things. • Small set of features combine in powerful ways. • Only innovative where innovation is really necessary. Copyright 2001, ActiveState More Usability features • Huge amount of free code and libraries • Interactive. • Designed to talk to the world. • Runs with Unix, Mac and Windows. • Integrates with JVM (Jython) and .NET Framework (Python.NET) • Talks MS COM, XPCOM, CORBA,SOAP, XML-RPC, … Copyright 2001, ActiveState Scalability features • Simple but powerful module system. • Simple but powerful class system. • Structured, standardized exceptions. Copyright 2001, ActiveState Environments • Unix (almost all) • Windows (3.1, 95, NT, CE) • Mac • JVM • Various legacy systems [...]... testing Copyright 2001, Python “Hello world" print "Hello, World“ Copyright 2001, Python interpreter • Just type: C:\> python Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> print "Hello, World" Hello, Python >>> print "Goodbye, World " Goodbye, Python >>> ^Z C:\> Copyright 2001, Byte-compiling • Python automatically... JPython) • Compiles Python classes to Java classes • Embedded interpreter allows interactive coding • Access to all Java classes • For better or worse: maintains Java's security/platform-independence bubble Copyright 2001, Jython can use Java tools • • • • • RDF XPointer Various parsers Swing GUI Unicode Copyright 2001, Python Limitations • “Ordinary Python" has 8-bit and Unicode string types – Handling...Extendable • New data types in Python or C • Modules in Python or C • Functions in Python or C Copyright 2001, Python isn't picky! • • • • COM/CORBA HTML /XML/ SGML Win API/POSIX You can write code that is portable or platform-specific Copyright 2001, Compared to Perl • • • • Simpler syntactically... get a pyc in the same directory • When the py is updated, the pyc is updated Copyright 2001, Interpreters • DOS/Win32 (last slide) • Unix (use ^D to exit) • Graphical: “IDLE”, “PythonWin” Copyright 2001, Python variables • Any Python variable can hold any value >>> width = 20 >>> height = 5 * 9 >>> width * height 900 >>> width = "really wide“ >>> width 'really wide' Copyright 2001, Numeric types • int: . ActiveState Preview • About Python • Python SAX/DOM • PyXML Package • Python XSLT/XPath • Python SOAP /XML- RPC • XML and Zope Copyright 2001, ActiveState What is Python? • Python is an easy to learn,. Copyright 2001, ActiveState Python and XML Copyright 2001, ActiveState About me • Paul Prescod, (paul@activestate.com) • ActiveState Senior Developer • Co-Author, XML Handbook Copyright 2001, ActiveState Preview • About. ActiveState Extendable • New data types in Python or C • Modules in Python or C • Functions in Python or C Copyright 2001, ActiveState Python isn't picky! • COM/CORBA • HTML /XML/ SGML • Win API/POSIX • You
Ngày đăng: 23/10/2014, 17:17
Xem thêm: python and xml, python and xml