Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the author
OK
IronPython in Action 1st Edition
Purchase options and add-ons
In 2005, Microsoft quietly announced an initiative to bring dynamic languages to the .NET platform. The starting point for this project was a .NET implementation of Python, dubbed IronPython. After a couple years of incubation, IronPython is ready for real-world use. It blends the simplicity, elegance, and dynamism of Python with the power of the .NET framework.
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.
Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.
- ISBN-101933988339
- ISBN-13978-1933988337
- Edition1st
- PublisherManning Publications
- Publication dateApril 14, 2009
- LanguageEnglish
- Dimensions7.38 x 1.02 x 9.25 inches
- Print length480 pages
Editorial Reviews
About the Author
Michael Foord has many years of Python under his belt as well as hands-on commercial experience with IronPython. Michael has written many articles on Python, including the official "HOWTO" Fetch Internet Resources Using urllib2". He has also written articles on IronPython and has spoken about IronPython in the U.S., England, and Poland. He is the author of several popular open-source Python projects and has a blog on all things Python.
Product details
- Publisher : Manning Publications; 1st edition (April 14, 2009)
- Language : English
- Paperback : 480 pages
- ISBN-10 : 1933988339
- ISBN-13 : 978-1933988337
- Item Weight : 1.88 pounds
- Dimensions : 7.38 x 1.02 x 9.25 inches
- Best Sellers Rank: #1,956,622 in Books (See Top 100 in Books)
- #363 in SQL
- #411 in C# Programming (Books)
- #499 in Software Design & Engineering
- Customer Reviews:
About the author

Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on Amazon-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
The authors really know their stuff and express it very well. I wish other authors would follow their lead. Some of the stated hyperlinks are stale, but that is to be expected of a 10 year old book. It'd be nice if the authors would consider publishing an updated version.
The book starts out with an introduction to Python itself and continues with a general description of how IronPython can use .NET types. It starts off by showing how to build a Winforms app using IronPython. If anything exposes the cruel, unnecessary complexity of .NET, it's got to be a Winforms app. The IronPython examples are easy to follow and it's always fun to create and manipulate a Winforms app using the IronPython console.
Chapter 4 talks about using Design patterns in IronPython. This is a refreshing change from most language books where patterns aren't mentioned at all. The chapter builds an IronPython application and uses the MVC pattern for the overall architecture and the command pattern for the implementation of the menu bar events.
Chapter 7 discusses agile testing and unit testing using IronPython. I almost dropped the book in amazement. Unit testing is almost never mentioned in any language book and is relegated to a niche or advanced topic. Find a book about any other .NET language that mentions unit testing that doesn't have the word "testing" in the title. This alone sets the quality of this book far above other language books I have read. It's not just enough, in my opinion, to discuss the syntax of the language. You have to teach the reader how to use the language in your everyday work.
The next section, section3, deals with a few core UI frameworks commonly used during .NET development, WPF, Silverlight, and ASP.NET, as well as showing how you can use IronPython to administer your system. Performing tedious tasks is my most common use of IronPython. I use it to automate moving files that fit a specific pattern out of my "downloads" directory to their proper places. It was great to learn a few new techniques for using IronPython in Powershell.
The last section talks about extending IronPython using C#, something which it sounds like should be avoided unless you just can't achieve decent performance with the equivalent IronPython code, and using IronPython as an embedde scripting engine. Python is used a lot in game programming because it's easy to embed. The nuts and bolts of the game engine will be written in low-level C/Assembly while the game logic and story is written in Python. I love the idea of having an embedded scripting engine in my application that will allow me to quickly extend my application at runtime. The user need to perform a new calculation on some data? Just send them an IronPython script and have them put it in a directory. It's a great idea and the book describes exactly how to do just that.
My overall feeling about this book is that it's a great book. The authors use the same humor and dry wit that Python is known for to great effect. Making the digestion of a very different language easier. I'm sure that as I continue to experiment with IronPython that I'll keep this book close at hand.
I'm not a computer programmer, I'm an engineer who occasionally needs to do a bit of (rather frustrated) computer tinkering. For that, I've long used Matlab (a product of the MathWorks company). Matlab works well for most things, but it has some rather serious technical limitations. More importantly, though, it's tremendously (prohibitely even) expensive. In contrast, Python is free, OpenSource and solves many of Matlab's serious problems.
So, a little more than a year ago, I did a bit of investigation and eventually decided to try IronPython. It tied into Microsoft's .Net library, it was real python, and it worked flawlessly on Windows. There was, however, just one problem: I didn't have the time to figure out Python programmming on my own. That's when I found Michael's book. And it has been a godsend.
As I said above, I'm not a computer programmer and computer programming isn't a skill I've ever wanted to properly acquire. My idea of computer programming is to find someone else's example and then poke and prod until it does something relatively close to what I need. I don't have the attention span for most books on the subject, and I don't have a great deal of desire (or any serious motivation) to learn better skills.
Foord's book simultaneously addressed two very real problems: 1) my own ignorance, 2) my impatience for results. The book nicely balances the need to teach skills with the need to show results. And I was well satisfied. The included examples are excellent, and I was able to get up and running on my own projects quickly. More importantly, though, I picked up quite a few insights on how to properly write a piece of code. For both of these reasons, this book easily earns its five stars. If you are interested in Python or .Net, it is an excellent reference. Do yourself a favor and just buy the book.
I know that Python allows you violate Encapsulation... Should you teach new developers this way?
Test cases have too many unnecessary details, might be good for an example, but will be horrible for real project. It would be nice to have cleaner approach.
Top reviews from other countries
The main example in the book is a .NET Win Forms application. The application covers a lot of ground of IronPython, Python, and .NET / C#. There's something in this book for anyone using .NET or Python.
IronPython in Action now fills that surprising gap.
The task the authors set themselves is an heroic one -- to teach Python to .net programmers, and .net to Python programmers, and, just in case that was not enough, several of the more outré parts of .net, and good programming practices, for just about everybody as well. What makes this a great book is that, in the course of about 450 pages, with copious external citations, they actually succeed.
Part of the secret of the success is that this (like Programming In Scala: A Comprehensive Step-By-Step Guide ) is not a beginner's book and assumes the reader has a degree of familiarity with basic programming concepts -- for example, the Python "if", "for" and "while" statements are covered together in just over a page, with the link collection in Appendix C there in case a more at length treatment is required -- so freeing space for more advanced material to be covered.
The coverage of the less glamorous parts of .net (such as the System.Management namespace) is more than many mainstream .net books bother with, and the coverage of the sexier new material (WPF, Silverlight) is more measured than in the typical technology-specific text -- enough to be worthwhile whatever .net language you might typically use, even if you don't catch the Python bug.
Declaration of interest: I get cited on page 221 for a blog post I made a couple of years ago.
There is no doubt that these two authors know their stuff and they are probably very rare and ideal for the task - there certainly aren't many books out there for this exact purpose of using Python on a .NET framework. They have got some great knowledge and enthusiasm but in my opinion it needs re-writing by someone else who doesn't over complicate matters - Technical authors are usually better teachers and they have a way of cutting to the chase and regurgitating stuff so that they understand it themselves and consequently can pass the same message on in a better way.
I don't know about you - but I am grateful that the internet now provides many free tutorials and knowledge - even though many such videos are poorly planned and presented. It would be very difficult to learn without it all. In the world of fast moving computing it is necessary to look at many of these different videos and books until the penny finally drops and I'm sure that given time - this book will play it's part and I will understand what the hell they are on about.