Getting Started with Iron Python in Visual Studio 2013 I’M Starting to Like Python Quite a Bit

Total Page:16

File Type:pdf, Size:1020Kb

Getting Started with Iron Python in Visual Studio 2013 I’M Starting to Like Python Quite a Bit Getting Started with Iron Python in Visual Studio 2013 I’m starting to like Python quite a bit. However, I’m less impressed with the Python development environments. And I love Visual Studio. Fortunately it turns out that it is very easy to get Python going in Visual Studio 2013. This makes it possible to write and debug Python in the best IDE in the universe. Installing the Python tools in Visual Studio 2013 If you have Visual Studio 2013 you just have to open Visual Studio 2013 and do this: 1. Try to create a Python project in Visual Studio 13 (I’m using the Ultimate edition, which is available to students under the Dreamspark initiative) 2. Click “Get Python Tools for Visual Studio.” This opens up a new window. 3. Click “Download Python Tools for Visual Studio”. 4. Click Run on the File Download warning. 5. Accept the licence terms. 6. The installer will bring in all the required elements and hook them into Visual Studio. 7. Note that this has just installed the Visual Studio tools, you don’t yet have Python on your computer. If you are using a different version of Visual Studio you can find installation details here: http://pytools.codeplex.com/ Installing Python Once you have the tools installed, you can add an implementation of Python. This seems a funny way round to do it, but it is how the installation instructions tell you how to do it, so who am I to argue. I went for the Iron Python option as this provides lots of neat ways to interact with C# programs. 1. Go to this URL: https://ironpython.codeplex.com/downloads/get/423690 2. Allow the installer to run. 3. Click Next to move to the setup configuration. 4. I installed everything. Once the installation has finished you should have a set of project types that you can use to create Python solutions. Rob Miles January 2014 .
Recommended publications
  • Ironpython in Action
    IronPytho IN ACTION Michael J. Foord Christian Muirhead FOREWORD BY JIM HUGUNIN MANNING IronPython in Action Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> IronPython in Action MICHAEL J. FOORD CHRISTIAN MUIRHEAD MANNING Greenwich (74° w. long.) Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: [email protected] ©2009 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine.
    [Show full text]
  • Working with Ironpython and WPF
    Working with IronPython and WPF Douglas Blank Bryn Mawr College Programming Paradigms Spring 2010 With thanks to: http://www.ironpython.info/ http://devhawk.net/ IronPython Demo with WPF >>> import clr >>> clr.AddReference("PresentationFramework") >>> from System.Windows import * >>> window = Window() >>> window.Title = "Hello" >>> window.Show() >>> button = Controls.Button() >>> button.Content = "Push Me" >>> panel = Controls.StackPanel() >>> window.Content = panel >>> panel.Children.Add(button) 0 >>> app = System.Windows.Application() >>> app.Run(window) XAML Example: Main.xaml <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x="http://schemas.microsoft.com/winfx/2006/xaml" Title="TestApp" Width="640" Height="480"> <StackPanel> <Label>Iron Python and WPF</Label> <ListBox Grid.Column="0" x:Name="listbox1" > <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Path=title}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> </Window> IronPython + XAML import sys if 'win' in sys.platform: import pythoncom pythoncom.CoInitialize() import clr clr.AddReference("System.Xml") clr.AddReference("PresentationFramework") clr.AddReference("PresentationCore") from System.IO import StringReader from System.Xml import XmlReader from System.Windows.Markup import XamlReader, XamlWriter from System.Windows import Window, Application xaml = """<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Title="XamlReader Example" Width="300" Height="200"> <StackPanel Margin="5"> <Button
    [Show full text]
  • Visual Studio 2010 Tools for Sharepoint Development
    Visual Studio 2010 for SharePoint Open XML and Content Controls COLUMNS Toolbox Visual Studio 2010 Tools for User Interfaces, Podcasts, Object-Relational Mappings SharePoint Development and More Steve Fox page 44 Scott Mitchell page 9 CLR Inside Out Profi ling the .NET Garbage- Collected Heap Subramanian Ramaswamy & Vance Morrison page 13 Event Tracing Event Tracing for Windows Basic Instincts Collection and Array Initializers in Visual Basic 2010 Generating Documents from SharePoint Using Open XML Adrian Spotty Bowles page 20 Content Controls Data Points Eric White page 52 Data Validation with Silverlight 3 and the DataForm John Papa page 30 Cutting Edge Data Binding in ASP.NET AJAX 4.0 Dino Esposito page 36 Patterns in Practice Functional Programming Core Instrumentation Events in Windows 7, Part 2 for Everyday .NET Developers MSDN Magazine Dr. Insung Park & Alex Bendetov page 60 Jeremy Miller page 68 Service Station Building RESTful Clients THIS MONTH at msdn.microsoft.com/magazine: Jon Flanders page 76 CONTRACT-FIRST WEB SERVICES: Schema-Based Development Foundations with Windows Communication Foundation Routers in the Service Bus Christian Weyer & Buddihke de Silva Juval Lowy page 82 TEST RUN: Partial Anitrandom String Testing Concurrent Affairs James McCaffrey Four Ways to Use the Concurrency TEAM SYSTEM: Customizing Work Items Runtime in Your C++ Projects Rick Molloy page 90 OCTOBER Brian A. Randell USABILITY IN PRACTICE: Getting Inside Your Users’ Heads 2009 Charles B. Kreitzberg & Ambrose Little Vol 24 No 10 Vol OCTOBER 2009 VOL 24 NO 10 OCTOBER 2009 VOLUME 24 NUMBER 10 LUCINDA ROWLEY Director EDITORIAL: [email protected] HOWARD DIERKING Editor-in-Chief WEB SITE MICHAEL RICHTER Webmaster CONTRIBUTING EDITORS Don Box, Keith Brown, Dino Esposito, Juval Lowy, Dr.
    [Show full text]
  • Pyrevit Documentation Release 4.7.0-Beta
    pyRevit Documentation Release 4.7.0-beta eirannejad May 15, 2019 Getting Started 1 How To Use This Documents3 2 Create Your First Command5 3 Anatomy of a pyRevit Script 7 3.1 Script Metadata Variables........................................7 3.2 pyrevit.script Module...........................................9 3.3 Appendix A: Builtin Parameters Provided by pyRevit Engine..................... 12 3.4 Appendix B: System Category Names.................................. 13 4 Effective Output/Input 19 4.1 Clickable Element Links......................................... 19 4.2 Tables................................................... 20 4.3 Code Output............................................... 21 4.4 Progress bars............................................... 21 4.5 Standard Prompts............................................. 22 4.6 Standard Dialogs............................................. 26 4.7 Base Forms................................................ 35 4.8 Graphs.................................................. 37 5 Keyboard Shortcuts 45 5.1 Shift-Click: Alternate/Config Script................................... 45 5.2 Ctrl-Click: Debug Mode......................................... 45 5.3 Alt-Click: Show Script file in Explorer................................. 46 5.4 Ctrl-Shift-Alt-Click: Reload Engine................................... 46 5.5 Shift-Win-Click: pyRevit Button Context Menu............................. 46 6 Extensions and Commmands 47 6.1 Why do I need an Extension....................................... 47 6.2 Extensions...............................................
    [Show full text]
  • Developers Toolkit Quickstart Guide
    Developers Toolkit QuickStart Guide Generic steps for all projects: Create a new project Import the Kratos_3.dll .NET assembly The Newtonsoft.Json.dll is also required Refer to the sample projects for the following steps Create a FactSetOnDemand object from the Kratos_3.RunTimePlatform namespace Set-up configuration data Create FactSet calls to retrieve data .NET Languages .NET language (C++/CLI, C#, Visual Basic, Java) Example Open Visual Studio Create a new project of the appropriate language type Add a reference to the Kratos_3 dll Configure the build to the appropriate architecture (x86 if using the 32-bit dll or x64 if using the 64-bit dll) Create a new code file (Refer to the sample projects for the following steps) Import the Kratos_3.RunTimePlatform namespace Create a FactSetOnDemand object Set-up configuration data Create FactSet calls to retrieve data IronPython For IronPython Put the Kratos_3.dll NET assembly somewhere your program will be able to reference it. Make sure your dll architecture matches your IronPython architecture. If you installed the 32-bit IronPython, use the x86 Kratos_3 dll. If you installed the 64-bit version of IronPython, use the x64 dll. Make a new Python file Import the clr module. (The steps below can be viewed in the IronPython sample program) Use the clr reference to load the Kratos_3 dll Import the Kratos_#.RunTimePlatform namespace Create a FactSetOnDemand object Set-up the configuration data Create FactSet calls to retrieve data To run an IronPython project Open the windows command console (not the IronPython console) Type: “ipy <path to python program>” FactSet Research Systems Inc.
    [Show full text]
  • Programming with Windows Forms
    A P P E N D I X A ■ ■ ■ Programming with Windows Forms Since the release of the .NET platform (circa 2001), the base class libraries have included a particular API named Windows Forms, represented primarily by the System.Windows.Forms.dll assembly. The Windows Forms toolkit provides the types necessary to build desktop graphical user interfaces (GUIs), create custom controls, manage resources (e.g., string tables and icons), and perform other desktop- centric programming tasks. In addition, a separate API named GDI+ (represented by the System.Drawing.dll assembly) provides additional types that allow programmers to generate 2D graphics, interact with networked printers, and manipulate image data. The Windows Forms (and GDI+) APIs remain alive and well within the .NET 4.0 platform, and they will exist within the base class library for quite some time (arguably forever). However, Microsoft has shipped a brand new GUI toolkit called Windows Presentation Foundation (WPF) since the release of .NET 3.0. As you saw in Chapters 27-31, WPF provides a massive amount of horsepower that you can use to build bleeding-edge user interfaces, and it has become the preferred desktop API for today’s .NET graphical user interfaces. The point of this appendix, however, is to provide a tour of the traditional Windows Forms API. One reason it is helpful to understand the original programming model: you can find many existing Windows Forms applications out there that will need to be maintained for some time to come. Also, many desktop GUIs simply might not require the horsepower offered by WPF.
    [Show full text]
  • Dipartimento Di Informatica E Scienze Dell'informazione
    Dipartimento di Informatica e • • Scienze dell'Informazione ••• • High performance implementation of Python for CLI/.NET with JIT compiler generation for dynamic languages. by Antonio Cuni Theses Series DISI-TH-2010-05 DISI, Universit`adi Genova v. Dodecaneso 35, 16146 Genova, Italy http://www.disi.unige.it/ Universit`adegli Studi di Genova Dipartimento di Informatica e Scienze dell'Informazione Dottorato di Ricerca in Informatica Ph.D. Thesis in Computer Science High performance implementation of Python for CLI/.NET with JIT compiler generation for dynamic languages. by Antonio Cuni July, 2010 Dottorato di Ricerca in Informatica Dipartimento di Informatica e Scienze dell'Informazione Universit`adegli Studi di Genova DISI, Univ. di Genova via Dodecaneso 35 I-16146 Genova, Italy http://www.disi.unige.it/ Ph.D. Thesis in Computer Science (S.S.D. INF/01) Submitted by Antonio Cuni DISI, Univ. di Genova [email protected] Date of submission: July 2010 Title: High performance implementation of Python for CLI/.NET with JIT compiler generator for dynamic languages. Advisor: Davide Ancona DISI, Univ. di Genova [email protected] Ext. Reviewers: Michael Leuschel STUPS Group, University of D¨usseldorf [email protected] Martin von L¨owis Hasso-Plattner-Institut [email protected] Abstract Python is a highly flexible and open source scripting language which has significantly grown in popularity in the last few years. However, all the existing implementations prevent programmers from developing very efficient code. This thesis describes a new and more efficient implementation of the language, obtained by developing new techniques and adapting old ones which have not yet been applied to Python.
    [Show full text]
  • NET Hacking & In-Memory Malware
    .NET Hacking & In-Memory Malware Shawn Edwards Shawn Edwards Cyber Adversarial Engineer The MITRE Corporation Hacker Maker Learner Take stuff apart. Change it. Put Motivated by an incessant Devoted to a continuous effort it back together. desire to create and craft. of learning and sharing knowledge. Red teamer. Adversary Numerous personal and emulator. professional projects. B.S. in Computer Science. Adversary Emulation @ MITRE • Red teaming, but specific threat actors • Use open-source knowledge of their TTPs to emulate their behavior and operations • Ensures techniques are accurate to real world • ATT&CK (Adversarial Tactics Techniques and Common Knowledge) • Public wiki of real-world adversary TTPs, software, and groups • CALDERA • Modular Automated Adversary Emulation framework Adversary Emulation @ MITRE • ATT&CK • Adversarial Tactics Techniques and Common Knowledge • Public wiki of real-world adversary TTPs, software, and groups • Lets blue team and red team speak in the same language • CALDERA • Modular Automated Adversary Emulation framework • Adversary Mode: • AI-driven “red team in a box” • Atomic Mode: • Define Adversaries, give them abilities, run operations. Customize everything at will. In-Memory Malware • Is not new • Process Injection has been around for a long time • Typically thought of as advanced tradecraft; not really • Surged in popularity recently • Made easier by open-source or commercial red team tools • For this talk, only discuss Windows malware • When relevant, will include the ATT&CK Technique ID In-Memory
    [Show full text]
  • NET Framework
    .NET Framework #.net 1 1: .NET Framework 2 2 2 . 2 Compact Framework 2 3 Examples 3 C # Hello World 3 Visual Basic .NET Hello World 3 Hello World in F # 4 C ++ / CLI Hello World 4 PowerShell Hello World 4 Nemerle 4 Oxygene 4 Boo Hello World 5 Hello World in Python (IronPython) 5 IL 5 2: .NET 6 6 6 Examples 6 6 3: .NET JSON Newtonsoft.Json 7 7 Examples 7 JSON 7 JSON . 7 4: ADO.NET 8 8 8 Examples 8 SQL 8 - SQL 8 ADO.NET 9 . 10 5: ASP.NET ASP.NET MVC 11 11 Examples 11 11 6: C # SHA1 13 13 Examples 13 # SHA1 13 7: C # SHA1 14 14 Examples 14 # SHA1 14 # 14 8: CLR 15 Examples 15 15 9: DateTime 16 Examples 16 ParseExact 16 TryParse 17 TryParseExact 18 10: HTTP 19 Examples 19 HTTP (HttpListener) 19 HTTP (ASP.NET ) 21 11: HTTP 23 23 Examples 23 System.Net.HttpWebRequest GET 23 System.Net.WebClient GET 23 System.Net.HttpClient GET 24 System.Net.HttpWebRequest POST 24 System.Net.WebClient POST 24 System.Net.HttpClient POST 25 System.Net.Http.HttpClient HTTP 25 12: JIT 27 27 27 Examples 27 27 13: JSON 30 30 Examples 30 System.Web.Script.Serialization.JavaScriptSerializer 30 Json.NET 30 Json.NET 30 - Newtonsoft.Json 31 31 JsonSerializerSettings Json.NET 32 14: LINQ 33 33 33 39 39 ToArray() ToList() ? 39 Examples 39 () 40 () 40 40 OrderByDescending 40 41 41 41 41 () 41 42 42 LastOrDefault 42 SingleOrDefault 42 FirstOrDefault 43 43 44 SelectMany () 44 45 45 45 SequenceEqual 45 46 OfType 46 46 46 46 47 47 GroupBy 47 ToDictionary 48 49 ToArray 49 ToList 49 49 49 ElementAtOrDefault 50 SkipWhile 50 TakeWhile 50 DefaultIfEmpty 50 () 51 51 52 53 54 54 54 55 55 55 15: NuGet 57 57 Examples 57 NuGet 57 UI 58 58 58 59 59 59 (MyGet, Klondike ) 59 UI () Nuget 59 61 16: ReadOnlyCollections 62 62 ReadOnlyCollections ImmutableCollection 62 Examples 62 ReadOnlyCollection 62 62 LINQ 62 62 ReadOnlyCollection 62 : ReadOnlyCollection .
    [Show full text]
  • Proceedings Der Linux Audio Conference 2018
    Proceedings of the Linux Audio Conference 2018 June 7th - 10th, 2018 c-base, in partnership with the Electronic Studio at TU Berlin Berlin, Germany Published by Henrik von Coler Frank Neumann David Runge http://lac.linuxaudio.org/2018 All copyrights remain with the authors. This work is licensed under the Creatice Commons Licence CC BY-SA 4.0 Published online on the institutional repository of the TU Berlin: DOI 10.14279/depositonce-7046 https://doi.org/10.14279/depositonce-7046 Credits Layout: Frank Neumann Typesetting: LATEX and pdfLaTeX Logo Design: The Linuxaudio.org logo and its variations copyright Thorsten Wilms c 2006, imported into "LAC 2014" logo by Robin Gareus Thanks to: Martin Monperrus for his webpage "Creating proceedings from PDF files" ii Partners and Sponsors Linuxaudio.org Technische Universität Berlin c-base Spektrum CCC Video Operation Center MOD Devices HEDD Native Instruments Ableton iii iv Foreword Welcome everyone to LAC 2018 in Berlin! This is the 15th edition of the Linux Audio Conference, or LAC, the international conference with an informal, workshop-like atmosphere and a unique blend of scientific and technical papers, tutorials, sound installations and concerts centering on the free GNU/Linux oper- ating system and open source software for audio, multimedia and musical applications. We hope that you will enjoy the conference and have a pleasant stay in Berlin! Henrik von Coler Robin Gareus David Runge Daniel Swärd Heiko Weinen v vi Conference Organization Core Team Henrik von Coler Robin Gareus David Runge
    [Show full text]
  • META-TRACING JUST-IN-TIME COMPILATION for RPYTHON Inaugural-Dissertation Zur Erlangung Des Doktorgrades Der Mathematisch-Naturwi
    META-TRACINGJUST-IN-TIMECOMPILATIONFORRPYTHON Inaugural-Dissertation zur Erlangung des Doktorgrades der Mathematisch-Naturwissenschaftlichen Fakultät der Heinrich-Heine-Universität Düsseldorf vorgelegt von Carl Friedrich Bolz September 2012 ABSTRACT Many dynamic languages are implemented using traditional inter- preters because implementing just-in-time (JIT) compilers for them is too complex. This limits their performance and restricts their ap- plicability. This thesis describes meta-tracing, a technique that makes it possible to apply a single tracing JIT compiler across a wide va- riety of languages. Meta-tracing is flexible enough to incorporate typical JIT techniques such as run-time type feedback and unboxing. With the help of several case studies, meta-tracing is applied to vari- ous language implementations. Performance measurements of using meta-tracing show improvements by up to factor 50 for implemen- tations of production languages. Meta-tracing can thus simplify the implementation of high-performance virtual machines for dynamic languages significantly, making these languages more practical ina wider context. iii ZUSAMMENFASSUNG Viele dynamische Programmiersprachen sind durch klassische In- terpreter implementiert, weil das Implementieren von Just-in- Time-Compilern für sie zu komplex ist. Dies schränkt ihre Geschwindigkeit und ihre Anwendbarkeit ein. In dieser Arbeit wird Meta-Tracing beschrieben, eine Methode, die es möglich macht, einen einzigen Tracing-JIT-Compiler auf eine große Bandbreite an Sprachen anzuwenden. Der Ansatz ist flexibel genug, typische JIT- Techniken zu ermöglichen, z.B. Laufzeit-Typ-Feedback und Unbox- ing. Mit Hilfe mehrerer Fallstudien wird Meta-Tracing evaluiert, indem es auf verschiedene Sprachimplementierungen angewendet wird. Geschwindigkeitsmessungen zeigen Verbesserungen von bis zu einem Faktor 50 für Implementierungen von Produktionssprachen.
    [Show full text]
  • Download the Nuget Slide Deck
    Rainer Stropek | time cockpit NuGet NuGet Package Manager für die Microsoft-Entwicklungsplattform Was ist NuGet? Werkzeug zur einfachen Verteilung von Paketen (=Libraries und Tools) Alles Notwendige in einem Paket Binaries für verschiedene Plattformen Optional Symbole und Sourcen Anpassungen am Projekt (z.B. Referenzen, Änderungen am app/web.config) UI-Integration in Visual Studio Ab VS2010, eingeschränkt auch in Mono Express-Editionen werden unterstützt http://www.nuget.org http://nuget.codeplex.com/ (Sourcecode) NuGet in Visual Studio NuGet in Visual Studio • Package Manager Console • PowerShell console in Visual Studio • Automate Visual Studio and NuGet • NuGet PowerShell Reference NuGet Pakete erstellen Kommandozeilentool nuget.exe Pakete erstellen (Pack Command) Pakete veröffentlichen (Push, Delete Command) Paket installieren (Install, Restore, Update Command) Generieren eines nuspec-Files (Spec Command) Wichtig für Buildautomatisierung Kommandozeilenreferenz NuGet Package Explorer Grafisches UI zur Erstellung/Bearbeitung von NuGet Paketen und nuspec Files http://npe.codeplex.com/ <?xml version="1.0" encoding="utf-16"?> <package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> <metadata> Example <id>CockpitFramework.Data</id> nuspec File <version>$version$</version> <title>Cockpit Framework Data Layer</title> <authors>software architects gmbh</authors> <owners>software architects gmbh</owners> <requireLicenseAcceptance>false</requireLicenseAcceptance> <description>...</description> <releaseNotes></releaseNotes>
    [Show full text]