Posts

Showing posts with the label wiki

Catching up with Devhawk: Using Python libraries from C#, the HawkCodeBox and a world tour

Devhawk, otherwise known as Harry Pierson, is the program manager for IronPython on the Microsoft dynamic languages team. He is a prolific, even more than me, has a whole bunch of interesting IronPython related posts that I've fallen behind on. The first set of posts is about building a hybrid Python / C# application, specifically using the awesome Pygments syntax highlighting library from a .NET application. Pygments for Windows Live Writer v1.0.2 Harry has been working on a syntax highlighting plugin for the Windows Live Writer desktop blogging tool. He's using Pygments via IronPython 2.6 Beta 2 to do the highlighting, and barring some problems with the import magic Pygments does (known by the IronPython team as “Harry’s Pygments Import Bug”) it works fine with IronPython. Building a Hybrid C# / IronPython App without Dynamic Type C# 4.0 introduces a new feature, the dynamic type, that will make embedding and interacting with dynamic languages from C# much easier. If you w...

A Good Mix 9: Cookbook recipes, articles and examples

Another selection of articles on IronPython from the last few weeks. Scripting: Reliably Finding my 32bit EXEs on a 32bit & 64bit OS or Where is IronPython? Saveen Reedy has a problem finding IronPython. More to the point he has an issue reliably finding the installed location when using both 32bit and 64bit versions of Windows (which have different standard install locations). Iron Python: How to talk to the .NET Framework A short blog entry demonstrating how IronPython integrates with the .NET framework by creating a simple GUI with Windows Forms and the interactive interpreter. The steps are virtually the same as I use when demoing IronPython to a .NET crowd. Creating Python Modules from CSharp This one is a bit meta, but still useful. It's a recipe I put on the IronPython cookbook and shows a 'slightly-different-from-the-usual' way to integrate C# with IronPython. It shows how you can use C# to programmatically create Python modules for use from IronPython. Back to ...

A Good Mix 5: Cookbook entries, ADODBAPI and IronPython with Asterisk

Only the finest selection of articles and blog posts on IronPython and related topics. Connection String Editor A recipe in the IronPython Cookbook showing how you can prompt the user for a connection string (for connecting to databases) using a built-in connection string editor dialog box from the Microsoft .NET Framework. IPY as AMI client thru AMIConnector A blog entry demonstrating the power of the interactive interpreter for exploring new libraries. This entry investigates AmiConnector , which is a .NET library for working with the Asterisk Manager. Kudos to Vernon Cole Dave Fugate, IronPython testing and infrastructure guy, pays homage to Vernon Cole for pywin32's adodbapi which runs under both CPython and IronPython. The tests have now been added to the IronPython test infrastructure so that the IronPython team will get early warning if they break it. Dave comments " Now I just need to setup Northwind databases on 40+ test machines... ". Self-executable scripts A...

A Good Mix 3: Releases, Tweeting and DIE

Another selection of recent posts on IronPython related subjects. All the posts in this mix are by Harry Pierson and Davy Mitchell ! First, DevHawk (Harry Pierson) has some comments on recent IronPython releases. AgDLR 0.5 This is the Dynamic Languages SDK for Silverlight that recently had a refresh for Silverlight 3. In this post Harry discusses XapHttpHandler , an ASP.NET handler for IIS that can dynamically build dynamic applications using Chiron. He particularly likes this feature as he wrote it! XapHttpHandler does the same exact on-demand XAP packaging for dynamic language Silverlight applications that Chiron does, but it’s implemented as an IHttpHandler so it plugs into the standard ASP.NET pipeline. All you have to do is put the Chiron.exe in your web application’s bin directory and add XapHttpHandler to your web.config IronPython 2.6 Alpha 1 Something else that got releases recently was the first alpha of IronPython 2.6. This version of IronPython will target Python 2.6, ...

End of Year Selection

A few months ago I got behind on posting interesting IronPython related links. I've caught up a lot, but a whole bunch of interesting stuff happened in November and December that I haven't reported yet. Some of that will have to wait for another day, but we'll end the year with a selection of some of the snippets from the last couple of months. IronPython Cookbook A couple of new recipes in the IronPython Cookbook , by Davy Mitchell and Atif Aziz: Process Monitor - demonstrates how to write a small utility in IronPython that monitors a process and re-launches it if it dies. How to Play a Wav - this short example plays a WAV format sound file using System.Media.SoundPlayer . Speech Synthesis in IronPython Another short example of how to use IronPython to make your computer speak like a robot: Speech Synthesis in IronPython Other Assortments IronPython in Bazaar - an import of the IronPython sources onto launchpad. Useful if you want to use a DVCS (Distributed Version Co...

Assorted Snippets

Here are a collection of recent blog entries that feature IronPython but don't quite qualify for an IronPython-URLs entry of their own. Starting with two new pages on the IronPython Cookbook : Validating a Filename A short recipe by Davy Mitchell that ensures user input is valid as a possible filename, removing invalid characters. Profiling for Silverlight An entry by Dan Eloff demonstrating performance profiling for IronPython Silverlight applications. Steve Gilham has been doing some odd things. Notably creating Java libraries in Java and Scala and then running them on .NET using the IKVM cross-compiler. I haven't been tracking them on this blog because most of the experiments have only been tangentially related to IronPython, but his latest entry is interesting. Here he is writing Scala (a very statically typed language for the Java Virtual Machine) code and using it from IronPython: Scaling the tower of Babel II Which of course begs the question why ?... it's still c...

New IronPython Wiki Pages: IronPython People, Knol, SSIS and MP3 tags

There are five new wiki pages, across three different wikis (well - perhaps two wikis and a pseudo wiki) about IronPython. There are three new pages on the IronPython Cookbook . People in IronPython A page on the different people in IronPython. It includes notes on the different teams and Microsoft and their roles, plus the Resolver Systems guys and a few other folk who've made contributions to the IronPython community. If there is someone missing who you think ought to be there, please add them. Programmatic Control of SSIS This is " a collection of utilities for programmatically controlling SQL 2005 SQL Server Integration Services (SSIS) packages with IronPython ". Read ID3 tags from an MP3 " This simple routine uses the Windows Shell to get MP3 file information from the tags. Due to the differences between Vista and XP different magic numbers are required to get the tags. " IronPython on Google Knol Knol is google's project for 'user created knowledg...

IronPython and Active Directory

Two new recipes have been posted to the IronPython Cookbook . They are both about interacting with Active Directory from IronPython. ActiveDirectory and RefreshCache DirectoryServices to Dictionary The first article shows how to use ' System.DirectoryServices ' and ' RefreshCache ' to load attributes not exposed by ADSI. The second is a helper object that turns ' DirectoryService' objects into Python dictionaries, which are easier to work with.

IronPython Cookbook: New Entries and Python.NET

Feihong Hsu (who is doing a talk on Python.NET at PyCon 2008 ) has added several new entries to the IronPython Cookbook . He has also updated more entries to make them compatible with Python.NET (or adding notes on ones that aren't compatible with Python.NET). New entries: Getting Images from the Clipboard Creating Multiframe TIFF Image Files Using the Webbrowser Widget Preview all Installed Fonts Basic Handwriting Recognition Preview all Installed Voices Speech Recognition WPF GUI Using XamlReader Those of you interested in trying Python.NET with .NET 2.0 SP1 may be interested in this blog entry by Feihong Hsu (with Windows Forms example code) on a Python.NET patch (with binaries) to make it work. Jeff Hardy has also been attempting to get SCons working with IronPython. He hasn't succeeded yet, but has written up his progress in the cookbook: SCons on IronPython .

Graphics with SDL, OpenGL and the Tao Framework

Sylvain Hellegouarch has posted some examples of working with OpenGL, from IronPython, to the IronPython Cookbook : OpenGL - Initializing Context With GLFW OpenGL - Rendering a spinning triangle with GLFW SDL for 2D Graphics with Zoom These examples use the Tao Framework .

Minor Mentions

A few recent blog entries featuring or mentioning IronPython: CALEBLOG: Garbage Collecting 2007 - a blogger includes being surprisingly interested by IronPython and the DLR in his mental garbage collecting of 2007. Python.NET - Alcides Fonseca is a fan of both .NET and Python. He likes IronPython, but prefers Python.NET. Playing with the DLR - Rainer experiments with the DLR. He shows code for executing IronPython, IronRuby and Managed JScript scripts by embedding the DLR (from IronPython 2) in C#. Mood News - Now IronPython Powered - Davy Mitchell's ' Mood News ' is now powered by IronPython Oh, and there are some more IronPython Cookbook updates: Launching the Browser - launching the system default browser with a specific url (includes cross platform notes) Access Unmanaged Code with Dynamic P/Invoke - an example of using the FePy implementation of ctypes for IronPython Parsing RSS - IronPython code for parsing RSS feeds

IronPython Cookbook Updates

There have been some great new additions to the IronPython Cookbook in recent weeks: Creating XML Trees - Using XML to LINQ features, that are new to .NET 3.5, with IronPython File as TextReader - a wrapper class, so that you can use Python files where .NET expects a StreamReader object Extremely Late Binding - Late bound COM with IronPython MonthCalendar Control and datetime - Using the Windows Forms MonthCalendar control with Python datetime Listing Time Zones - Listing time zones known to the system Using Spreadsheet Functions with Excel 2007 - more COM Listing all Exceptions in the System Plus the IronPython 2.0A7 files have been added to the Downloads page.

IronPython Cookbook Updates

There have been several new entries in the IronPython Cookbook since I last mentioned it. New material includes: A new Silverlight Section Uploading a File by FTP - using the edFTPnet library. Entry by Davy Mitchell . Creating a Pie Chart with Zedgraph - also by Davy Mitchell. Plus various other new entries of course. If you haven't seen the cookbook before, it contains many examples of using .NET libraries from IronPython and also embedding IronPython into .NET applications.

Handling POST with HttpListener and ProgressBar

There are two new recipes on the IronPython cookbook: How to Handle POST with HttpListener - this comes from Konrad and is how to handle POST requests when writing servers that use HttpListener. Windows Forms Progress Bar - A simple example of a progress bar using Windows Forms. The progress bar is updated from a calculation performed on a separate thread.

New and Updated Recipes in the Cookbook

There have been several new entries in the IronPython cookbook recently: The IronPython 2 Parser - An example of using the IronPython 2 Parser API to extract the variable names used in a Python expression. Screen Capture - Taking a screenshot from IronPython with Windows Forms. Using Python Functions from C# - An example of embedding IronPython 2 in C# that creates IronPython functions and calls them from C#. A while ago Andrzej Krzywda posted an example of downloading web pages with IronPython. It turns out that the examples can be made even shorter. See Accessing the Web with IronPython for details. The IronPython Cookbook Downloading a Web Page recipe has been appropriately updated.

Using Python Classes from .NET

IronPython classes aren't true .NET classes, not least because you can swap out their base classes dynamically, add methods and have all sorts of dynamic fun with them if you really want to. There are ways to use IronPython classes from C# (and other .NET languages) though. This cookbook recipe shows one approach, which involves inheriting from a C# class: Using Python Classes from .NET

IronPython from Boo

Not got enough Python on .NET? The Boo (a Python inspired language) cookbook shows how to use IronPython from Boo: Using IronPython from Boo

Reading CSV Files, Folder Backup, Interop and the SaveFileDialog on the IronPython Cookbook

New additions to the IronPython Cookbook include: Reading CSV Files with a Fast Csv Reader Deploying ironPython Scripts by Dodiggitydag (!) Introduction to Interop by Seo Sanghyeon Folder Backup Script also by Dodiggitydag; it uses the open source SharpZipLib The Windows Forms SaveFileDialog

New Entries in the IronPython Cookbook

Recent additions to the IronPython Cookbook include: Creating a Shortcut File with WSH Interop Reading the Target of a Shortcut with Shell32 Interop Invoking onto the Control Thread (Windows Forms) Reading and Writing JPG Metadata with .NET 3 Transform XML Files with XSL Message Queuing Enumerating Installed Fonts

Making POSTs, Launching Subprocess and Wiki Additions

Andrzej Krzywda has done a new blog entry: How to programmatically submit a POST form using IronPython Steve Gilham has done a blog entry about launching subprocesses with IronPython: Spawning a process in IronPython Both of these examples are in the IronPython Cookbook Wiki , along with several more additions like: Watching the FileSystem Connecting to Active Directory - using a Powershell assembly from IronPython Setting the Clipboard - Using Windows Forms to set the clipboard (and creating a Single Threaded Apartmentstate (STA) Thread). Working with File Paths has been expanded, and the following pages filled in: Core Concepts IronPython FePy: The IronPython Community Edition The DLR: Dynamic Language Runtime The .NET Framework Mono Silverlight