Iron Python in Action +code

Купить бумажную книгу и читать

Купить бумажную книгу

По кнопке выше можно купить бумажные варианты этой книги и похожих книг на сайте интернет-магазина "Лабиринт".

Using the button above you can buy paper versions of this book and similar books on the website of the "Labyrinth" online store.

Реклама. ООО "ЛАБИРИНТ.РУ", ИНН: 7728644571, erid: LatgCADz8.

Название:Iron Python in Action

Автор: Michael J. Foord , Christian Muirhead

Издательство: Manning Publications

Год: 2009

Страниц:480

Язык: English

Формат: pdf+code

Размер: 7,9 Mb+33,3 Mb

IronPython in Action offers a comprehensive, hands-on introduction to Microsoft's exciting new approach for programming the .NET framework. It approaches IronPython as a first class .NET language, fully integrated with the .NET environment, Visual Studio, and even the open-source Mono implementation. You'll learn how IronPython can be embedded as a ready-made scripting language into C# and VB.NET programs, used for writing full applications or for web development with ASP. Even better, you'll see how IronPython works in Silverlight for client-side web programming.

IronPython opens up exciting new possibilities. Because it's a dynamic language, it permits programming paradigms not easily available in VB and C#. In this book, authors Michael Foord and Christian Muirhead explore the world of functional programming, live introspection, dynamic typing and duck typing , metaprogramming, and more.

IronPython in Action explores these topics with examples, making use of the Python interactive console to explore the .NET framework with live objects. The expert authors provide a complete introduction for programmers to both the Python language and the power of the .NET framework. The book also shows how to extend IronPython with C#, extending C# and VB.NET applications with Python, using IronPython with .NET 3.0 and Powershell, IronPython as a Windows scripting tool, and much more.

Table of Contents

Part 1: Getting Started with IronPython

A New Language for .NET

1.1 An Introduction to IronPython

1.1.1 What is IronPython?

1.1.2 A Brief History of IronPython

1.1.3 IronPython for Python Programmers

1.1.4 IronPython for .NET Programmers

1.2 Python on the CLR

1.2.1 Dynamic Languages on .NET and the DLR

1.2.2 Silverlight, a New CLR

1.2.3 The Python Programming Language

1.2.4 Multiple Programming Paradigms

1.3 Live Objects on the Console - the Interactive Interpreter

1.3.1 Using the Interactive Interpreter

1.3.2 .NET Framework: assemblies, namespaces and classes

1.3.3 Live objects and the Interactive Interpreter

1.3.4 Object Introspection with dir and help

1.4 Summary

Introduction to Python

2.1 An Overview of Python

2.1.1 Python datatypes

2.1.2 Names, Objects and References

2.1.3 Mutable and immutable objects

2.2 Python: Basic Constructs

2.2.1 Statements and expressions

2.2.2 Conditionals and loops

2.2.3 Functions

2.2.4 Built in Functions

2.2.5 Classes

2.3 Additional Python Features

2.3.1 Exception Handling

2.3.2 Closures and scoping rules

2.3.3 List Comprehensions

2.3.4 Modules, Packages and Importing

2.3.5 Docstrings

2.3.6 The Python Standard Library

2.4 Summary

.NET Objects & IronPython

3.1 Introducing .NET

3.1.1 Translating MSDN Documentation into IronPython

3.1.2 The Form Class

3.2 Structures, Enumerations and Collections: .NET Types

3.2.1 Methods and properties inherited from Control

3.2.2 Adding a Label to the Form: ControlCollection

3.2.3 Configuring the Label: The Color Structure

3.2.4 The FormBorderStyle Enumeration

3.2.5 Hello World with Form and Label

3.3 Handling Events

3.3.1 The MouseMove Event

3.3.2 Event Handlers in IronPython

3.4 Subclassing .NET Types

3.5 Summary

Part 2: Core Development Techniques

Writing an Application, and Design Patterns with IronPython

4.1 Data Modelling and Duck Typing

4.1.1 Python and Protocols

4.1.2 Duck Typing in Action

4.2 Model View Controller in IronPython

4.2.1 Introducing the Running Example

4.2.2 The View Layer: Creating a User Interface

4.2.3 A Data Model

4.2.4 A Controller Class

4.3 The Command Pattern

4.3.1 The SaveFileDialog

4.3.2 Writing Files: the .NET & Python Ways

4.3.3 Handling exceptions and the system message box

4.3.4 The Save Command, a Python Class

4.3.5 The SaveAs Command

4.4 Integrating Commands with Our Running Example

4.4.1 Menu Classes and Lambda

4.4.2 Toolbar and Images, .NET Classes

4.4.3 Bringing the GUI to Life

4.5 Summary

First Class Functions in Action with XML

5.1 First Class Functions

5.1.1 Higher Order Functions

5.1.2 Python Decorators

5.1.3 A Null Argument Checking Decorator

5.2 Representing Documents with XML

5.2.1 The .NET XmlWriter

5.2.2 A DocumentWriter Class

5.2.3 An Alternative with an Inner Function

5.3 Reading XML

5.3.1 XmlReader

5.3.2 An IronPython XML Document Reader

5.4 Handler Functions for MultiDoc XML

5.5 The Open Command

5.6 Summary

Properties, Dialogs and Visual Studio

6.1 Document Observers

6.1.1 Python properties

6.1.2 Document Observers on the MainForm

6.1.3 Adding the OpenCommand

6.2 More with TabPages: Dialogs and Visual Studio

6.2.1 Remove Pages: Ok and Cancel Dialog

6.2.2 Rename Pages: A Modal Dialog

6.2.3 Visual Studio Express and IronPython

6.2.4 Adding Pages: Code Reuse in Action

6.2.5 Wiring the Commands to the View

6.3 Object Serializing with BinaryFormatter

6.4 Summary

Agile Testing - Where Dynamic Typing Shines

7.1 The unitest module

7.1.1 Creating a TestCase

7.1.2 setup and tearDown

7.1.3 Test Suites with Multiple Modules

7.2.Testing with Mocks

7.2.1 Mock Objects

7.2.2 Modifying Live Objects: The Art of the Monkey Patch

7.2.3 Mocks and Dependency Injection

7.3 Functional Testing

7.3.1 Interacting with the GUI Thread

7.3.2 An AsyncExecutor for Asynchronous Interactions

7.3.3 The Functional Test: Making MultiDoc Dance

7.4 Summary

Getting Deeper into IronPython: Metaprogramming, Protocols and More

8.1 Protocols instead of Interfaces

8.1.1 A Myriad of Magic Methods

8.1.2 Operator Overloading

8.1.3 Iteration

8.1.4 Generators

8.1.5 Equality and Inequality

8.2 Dynamic Attribute Access

8.2.1 Attribute Access through Builtin Functions

8.2.2 Attribute Access through Magic Methods

8.2.3 Proxying Attribute Access

8.3 Metaprogramming

8.3.1 Introduction to Metaclasses

8.3.2 Uses of Metaclasses

8.3.3 A Profiling Metaclass

8.4 IronPython and the CLR

8.4.1 .NET Arrays

8.4.2 Overloaded Methods

8.4.3 'out', 'ref', 'params' and Pointer Parameters

8.4.4 Value Types

8.4.5 Interfaces

8.4.6 Attributes

8.5.Summary

Part 3: IronPython and Advanced .NET

WPF and IronPython

9.1 Hello World with WPF and IronPython

9.1.1 WPF from Code

9.1.2 Hello World from XAML

9.2 WPF in Action

9.2.1 Layout with the Grid

9.2.2 The WPF ComboBox and CheckBox

9.2.3 The Image Control

9.2.4 The Expander

9.2.5 The ScrollViewer

9.2.6 The TextBlock a Lightweight Document Viewer

9.2.7 The XamlWriter

9.3 XPS Documents and Flow Content

9.3.1 FlowDocument Viewer Classes

9.3.2 Flow Document Markup

9.3.3 Document XAML and Object Tree Processing

9.4 Summary

Windows System Administration with IronPython

10.1 System Administration with IronPython

10.1.1 Simple Scripts

10.1.2 Shell Scripting with IronPython

10.2. WMI and the System.Management Assembly

10.2.1 System.Management

10.2.2 Connecting to remote Computers

10.3 Powershell & IronPython

10.3.1. Using Powershell from IronPython

10.3.2. Using IronPython inside Powershell

10.4 Summary

IronPython and ASP.NET

11.1 Introducing ASP.NET

11.1.1 Web controls

11.1.2 Pages and user controls

11.1.3 Rendering, server code and the page lifecycle

11.2 Adding IronPython to ASP.NET

11.2.1 Writing a first application

11.2.2 Creating a project

11.3 ASP.NET Infrastructure

11.3.1 The App_Script Folder

11.3.2 The Global.py File

11.3.3 The Web.config File

11.4 A Web-based MultiDoc Viewer

11.4.1 Page Structure

11.4.2 Code-behind

11.5 Editing MultiDocs

11.5.1 Swapping Controls

11.5.2 Handling Viewstate

11.5.3 Additional Events

11.6 Converting the Editor into a User Control

11.6.1 Viewstate Again

11.6.2 Adding Parameters

11.7 Summary

Databases and Web Services

12.1 Relational databases and ADO.NET

12.1.1 Trying it out using PostgreSQL

12.1.2 Connecting to the database

12.1.3 Executing commands

12.1.4 Setting parameters

12.1.5 Querying the database

12.1.6 Reading multi-row results

12.1.7 Using transactions

12.1.8 DataSets

12.1.9 Databinding

12.2 Web services

12.2.1 Using a simple web service

12.2.2 Using SOAP services from IronPython

12.2.3 REST services in IronPython

12.3 Summary

Silverlight: IronPython in the Browser

13.1. Introduction to Silverlight

13.1.1. Dynamic Silverlight

13.1.2. Your Python Application

13.1.3. Silverlight Controls

13.1.4. Packaging a Silverlight Application

13.2. A Silverlight Twitter Client

13.2.1. Cross Domain Policies

13.2.2. Debugging Silverlight Applications

13.2.3. The User Interface and a Password TextBox

13.2.4. Accessing Network Resources

13.2.5. Threading and Dispatching onto the UI Thread

13.2.6. IsolatedStorage in the Browser

13.3. Videos and the Browser DOM

13.3.1. The MediaElement Video Player

13.3.2. Interacting with the Browser DOM

13.4. Summary

Part 4: Reaching Out with IronPython

Extending IronPython with C# / VB.NET

14.1. Writing a Class Library for IronPython

14.1.1. Working with Visual Studio or MonoDevelop

14.1.2. Python Objects from Class Libraries

14.1.3. Calling Unmanaged Code with the P/Invoke Attribute

14.1.4. Methods with Attributes through Subclassing

14.2. Creating Dynamic (and Pythonic) Objects from C# / VB.NET

14.2.1. Creating Dynamic Objects

14.2.2. Python Magic Methods

14.2.3. APIs with Keyword and Multiple Arguments

14.3. Compiling and Using Assemblies at Runtime

14.4. Summary

Embedding the IronPython Engine

15.1. Creating a custom Executable

15.1.1. The IronPython Engine

15.1.2. Executing a Python File

15.2. IronPython as a Scripting Engine

15.2.1. Setting and Fetching Variables from a Scope

15.2.2. Providing Modules and Assemblies for the Engine

15.2.3. Python Code as an Embedded Resource

15.3. Python Plugins for .NET Applications

15.3.1. A Plugin Class and Registry

15.3.2. Auto-discovery of User Plugins

15.3.3. Calling the User Plugins

15.4. Using DLR Objects from Other .NET Languages

15.4.1. Expressions, Functions and Python Types

15.4.2. Dynamic Operations with ObjectOperations

15.4.3. The Builtin Python Functions and Modules

15.5. Summary

book

code

Дата создания страницы: