SlideShare a Scribd company logo
Python   Python Tools for VS                   DLR i IronPython   Zaklju£ak




         Python Tools for Visual Studio
             Python na Microsoftovom .NET-u




                               Nikola Pleji¢


                           nikola@plejic.com

                        http://nikola.plejic.com




                 DevUG Zagreb, 27.10.2011.
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
Python              Python Tools for VS   DLR i IronPython   Zaklju£ak

Outline

     1   Python
           Uvod
           Kratak vodi£ kroz jezik



     2   Python Tools for VS
           Instalacija



     3   DLR i IronPython
           Dynamic Language Runtime
           Uporaba IronPythona
Python          Python Tools for VS     DLR i IronPython   Zaklju£ak

Python?



         > print(Hello, world!)
         Hello, world!
Python                Python Tools for VS          DLR i IronPython   Zaklju£ak

Python?



         •   op¢eniti, objektno-orijentirani high-level jezik
Python                Python Tools for VS          DLR i IronPython   Zaklju£ak

Python?



         •   op¢eniti, objektno-orijentirani high-level jezik

         •   dinami£ki, strongly typed
Python                Python Tools for VS          DLR i IronPython   Zaklju£ak

Python?



         •   op¢eniti, objektno-orijentirani high-level jezik

         •   dinami£ki, strongly typed

         •   fokus na £itljivost i jednostavnost sintakse
Python                 Python Tools for VS                  DLR i IronPython     Zaklju£ak

The Zen of Python

          import this

         The Zen of Python, by Tim Peters


         Beautiful is better than ugly.
         Explicit is better than implicit.
         Simple is better than complex.
         Complex is better than complicated.
         Flat is better than nested.
         Sparse is better than dense.
         Readability counts.
         Special cases aren't special enough to break the rules.
         Although practicality beats purity.
         Errors should never pass silently.
         Unless explicitly silenced.
         In the face of ambiguity, refuse the temptation to guess.
         There should be one-- and preferably only one --obvious way to do it.
         Although that way may not be obvious at first unless you're Dutch.
         Now is better than never.
         Although never is often better than *right* now.
         If the implementation is hard to explain, it's a bad idea.
         If the implementation is easy to explain, it may be a good idea.
         Namespaces are one honking great idea -- let's do more of those!
Python               Python Tools for VS   DLR i IronPython   Zaklju£ak

Kratka povijest



         •   nastao krajem 1989. godine
Python               Python Tools for VS      DLR i IronPython          Zaklju£ak

Kratka povijest



         •   nastao krajem 1989. godine

         •   Guido van Rossum (BDFL  Benevolent Dictator For Life)
Python               Python Tools for VS      DLR i IronPython          Zaklju£ak

Kratka povijest



         •   nastao krajem 1989. godine

         •   Guido van Rossum (BDFL  Benevolent Dictator For Life)

         •   Python 2 vs. Python 3
Python               Python Tools for VS      DLR i IronPython   Zaklju£ak

Implementacije



         •   referentna implementacija  CPython
Python               Python Tools for VS      DLR i IronPython   Zaklju£ak

Implementacije



         •   referentna implementacija  CPython

         •   Jython, IronPython, PyPy
Python               Python Tools for VS       DLR i IronPython   Zaklju£ak

Implementacije



         •   referentna implementacija  CPython

         •   Jython, IronPython, PyPy

         •   raznorazni kompajleri (Pyjamas, Pyrex, Cython)
Python                Python Tools for VS   DLR i IronPython   Zaklju£ak

Osnovni tipovi podataka


         •   sve je objekt
Python                 Python Tools for VS         DLR i IronPython   Zaklju£ak

Osnovni tipovi podataka


         •   sve je objekt


         •   string vs. unicode

               •   ne i u IronPythonu (string == unicode)
Python                  Python Tools for VS         DLR i IronPython   Zaklju£ak

Osnovni tipovi podataka


         •   sve je objekt


         •   string vs. unicode

                •   ne i u IronPythonu (string == unicode)

         •   liste, tuplei
Python                  Python Tools for VS         DLR i IronPython   Zaklju£ak

Osnovni tipovi podataka


         •   sve je objekt


         •   string vs. unicode

                •   ne i u IronPythonu (string == unicode)

         •   liste, tuplei


         •   dictionaries
Python               Python Tools for VS   DLR i IronPython   Zaklju£ak

Comprehensions


         •   list comprehensions
Python               Python Tools for VS   DLR i IronPython   Zaklju£ak

Comprehensions


         •   list comprehensions


         •   dictionary comprehensions
Python                 Python Tools for VS    DLR i IronPython   Zaklju£ak

Comprehensions


         •   list comprehensions


         •   dictionary comprehensions


         •   generatori

               •   generator comprehensions
Python               Python Tools for VS   DLR i IronPython   Zaklju£ak

Objektni model

         •   klase
Python                Python Tools for VS   DLR i IronPython   Zaklju£ak

Objektni model

         •   klase


         •   klase su objekti
Python                 Python Tools for VS          DLR i IronPython            Zaklju£ak

Objektni model

         •   klase


         •   klase su objekti


         •   metaklase

               •    [...] deeper magic than 99% of users should ever worry about.
                   If you wonder whether you need them, you don't (the people
                   who actually need them know with certainty that they need
                   them, and don't need an explanation about why). ~ Tim
                   Peters
Python                  Python Tools for VS           DLR i IronPython     Zaklju£ak

’to nam treba?

         •    distribucija Pythona

                •   standardni interpreter, ActiveState, IronPython, ...




         1   http://pytools.codeplex.com/
         2   http://ipython.org/
         3   MSI na https://github.com/zeromq/pyzmq/downloads
Python                  Python Tools for VS           DLR i IronPython     Zaklju£ak

’to nam treba?

         •    distribucija Pythona

                •   standardni interpreter, ActiveState, IronPython, ...

         •    Visual Studio ili besplatni Visual Studio Shell

                •   ne i VS Express!




         1   http://pytools.codeplex.com/
         2   http://ipython.org/
         3   MSI na https://github.com/zeromq/pyzmq/downloads
Python                  Python Tools for VS           DLR i IronPython     Zaklju£ak

’to nam treba?

         •    distribucija Pythona

                •   standardni interpreter, ActiveState, IronPython, ...

         •    Visual Studio ili besplatni Visual Studio Shell

                •   ne i VS Express!

                                                 1
         •    Python Tools for Visual Studio




         1   http://pytools.codeplex.com/
         2   http://ipython.org/
         3   MSI na https://github.com/zeromq/pyzmq/downloads
Python                     Python Tools for VS           DLR i IronPython   Zaklju£ak

’to nam treba?

         •    distribucija Pythona

                •   standardni interpreter, ActiveState, IronPython, ...

         •    Visual Studio ili besplatni Visual Studio Shell

                •   ne i VS Express!

                                                     1
         •    Python Tools for Visual Studio

                       2
         •    IPython

                •   alternativni (ne-samo-)Python shell
                •   potreban pyzmq 2.1.4
                                                 3




         1   http://pytools.codeplex.com/
         2   http://ipython.org/
         3   MSI na https://github.com/zeromq/pyzmq/downloads
Python                  Python Tools for VS   DLR i IronPython   Zaklju£ak

’to dobivamo?


         •    IntelliSense




         4   samo u VS Ultimate :(
Python                  Python Tools for VS   DLR i IronPython   Zaklju£ak

’to dobivamo?


         •    IntelliSense

         •    project management




         4   samo u VS Ultimate :(
Python                  Python Tools for VS   DLR i IronPython   Zaklju£ak

’to dobivamo?


         •    IntelliSense

         •    project management

         •    debugger




         4   samo u VS Ultimate :(
Python                       Python Tools for VS   DLR i IronPython   Zaklju£ak

’to dobivamo?


         •    IntelliSense

         •    project management

         •    debugger

                         4
         •    proling




         4   samo u VS Ultimate :(
Python                Python Tools for VS      DLR i IronPython            Zaklju£ak

’to je DLR?

         •   skup libraryja nad CLR-om koji olak²ava hostanje dinami£kih
             jezika
Python                Python Tools for VS           DLR i IronPython       Zaklju£ak

’to je DLR?

         •   skup libraryja nad CLR-om koji olak²ava hostanje dinami£kih
             jezika


         •   izvu£en iz ranih verzija IronPythona
Python                Python Tools for VS           DLR i IronPython       Zaklju£ak

’to je DLR?

         •   skup libraryja nad CLR-om koji olak²ava hostanje dinami£kih
             jezika


         •   izvu£en iz ranih verzija IronPythona


         •   zajedni£ka podloga za sve dinami£ke jezike na .NET-u
             (IronRuby, IronScheme)
Python                Python Tools for VS           DLR i IronPython       Zaklju£ak

’to je DLR?

         •   skup libraryja nad CLR-om koji olak²ava hostanje dinami£kih
             jezika


         •   izvu£en iz ranih verzija IronPythona


         •   zajedni£ka podloga za sve dinami£ke jezike na .NET-u
             (IronRuby, IronScheme)


         •   pro²irenje postoje¢im stati£kim jezicima (dynamic dispatching
             @ C# 4.0)
Python                Python Tools for VS           DLR i IronPython       Zaklju£ak

’to je DLR?

         •   skup libraryja nad CLR-om koji olak²ava hostanje dinami£kih
             jezika


         •   izvu£en iz ranih verzija IronPythona


         •   zajedni£ka podloga za sve dinami£ke jezike na .NET-u
             (IronRuby, IronScheme)


         •   pro²irenje postoje¢im stati£kim jezicima (dynamic dispatching
             @ C# 4.0)


         •   .NET Framework 4.0 + Mono 2.8+ po defaultu
Python               Python Tools for VS   DLR i IronPython   Zaklju£ak

Kratka povijest IronPythona


         •   Jim Hugunin, 2006.
Python               Python Tools for VS       DLR i IronPython   Zaklju£ak

Kratka povijest IronPythona


         •   Jim Hugunin, 2006.


         •   danas: Microsoft (razvoj na CodePlexu)
Python               Python Tools for VS       DLR i IronPython   Zaklju£ak

Kratka povijest IronPythona


         •   Jim Hugunin, 2006.


         •   danas: Microsoft (razvoj na CodePlexu)


         •   open source (Apache 2.0)
Python                Python Tools for VS        DLR i IronPython   Zaklju£ak

Kratka povijest IronPythona


         •   Jim Hugunin, 2006.


         •   danas: Microsoft (razvoj na CodePlexu)


         •   open source (Apache 2.0)


         •   aktivno razvijan (zadnji release: 21.10.2011.)
Python                 Python Tools for VS         DLR i IronPython            Zaklju£ak

Featurei


         • ≈   CPython 2.7 uz manje razlike, npr.:

               •   string == unicode
               •   Python podrºava vi²estruko naslježivanje, CLR ne podrºava
Python                 Python Tools for VS         DLR i IronPython            Zaklju£ak

Featurei


         • ≈   CPython 2.7 uz manje razlike, npr.:

               •   string == unicode
               •   Python podrºava vi²estruko naslježivanje, CLR ne podrºava


         •   integracija s .NET frameworkom
Python                 Python Tools for VS         DLR i IronPython            Zaklju£ak

Featurei


         • ≈   CPython 2.7 uz manje razlike, npr.:

               •   string == unicode
               •   Python podrºava vi²estruko naslježivanje, CLR ne podrºava


         •   integracija s .NET frameworkom


         •   Silverlight scripting
Python          Python Tools for VS   DLR i IronPython   Zaklju£ak

Pri£anje s .NET-om

         # deklaracija referenci
         import clr
         clr.AddReference(System.Xml)

         # namespacevi
         import System
         from System.Xml import *
         xmldoc = XmlDocument()

         # alternativno:
         # import system
         # xmldoc = System.Xml.XmlDocument()
Python                 Python Tools for VS          DLR i IronPython           Zaklju£ak

Pri£anje s .NET-om (smjer #2)

                                                     5
         •    DLR Hosting API (= free scripting!)




         5   http://dlr.codeplex.com/wikipage?title=Docs%20and%20specsreferringTitle=Do
Python                  Python Tools for VS         DLR i IronPython           Zaklju£ak

Pri£anje s .NET-om (smjer #2)

                                                     5
         •    DLR Hosting API (= free scripting!)


         •    kompajliranje IronPython aplikacije u .NET assembly

                •   While the assemblies produced by the IronPython Hosting
                    APIs are true .NET assemblies, the dynamic nature of the
                    Python language makes it dicult to use these from other
                    .NET languages. In short, this means that attempting to
                    import Python types into other .NET languages such as C# is
                    not recommended.




         5   http://dlr.codeplex.com/wikipage?title=Docs%20and%20specsreferringTitle=Do
Python                 Python Tools for VS          DLR i IronPython   Zaklju£ak

ASP.NET i IronPython


         •    WebForms uz ASP.NET Dynamic Language Support




         6   http://github.com/jschementi/ironrubymvc
Python                   Python Tools for VS        DLR i IronPython           Zaklju£ak

ASP.NET i IronPython


         •    WebForms uz ASP.NET Dynamic Language Support


         •    ASP.NET MVC

                 •   http://www.codevoyeur.com/Articles/Tags/ironpython.aspx
                 •   Rubyja²i su bolje pro²li
                                               6




         6   http://github.com/jschementi/ironrubymvc
Python                   Python Tools for VS             DLR i IronPython   Zaklju£ak

Alternative

                     7
         •    Boo

                 •   sintaksa inspirirana Pythonom
                 •   stati£ki tipiziran (type inferencing)
                 •   makroi




         7   http://boo.codehaus.org/
         8   http://ironruby.net/
         9   http://ironscheme.codeplex.com/
Python                   Python Tools for VS             DLR i IronPython   Zaklju£ak

Alternative

                     7
         •    Boo

                 •   sintaksa inspirirana Pythonom
                 •   stati£ki tipiziran (type inferencing)
                 •   makroi


                          8
         •    IronRuby




         7   http://boo.codehaus.org/
         8   http://ironruby.net/
         9   http://ironscheme.codeplex.com/
Python                   Python Tools for VS             DLR i IronPython   Zaklju£ak

Alternative

                     7
         •    Boo

                 •   sintaksa inspirirana Pythonom
                 •   stati£ki tipiziran (type inferencing)
                 •   makroi


                          8
         •    IronRuby

                               9
         •    IronScheme?

                 •   skoro-pa-R6RS Scheme




         7   http://boo.codehaus.org/
         8   http://ironruby.net/
         9   http://ironscheme.codeplex.com/
Python               Python Tools for VS       DLR i IronPython         Zaklju£ak

Zaklju£ak


         •   ozbiljan, dobro podrºan dinami£ki jezik na CLR-u i Monou
Python                Python Tools for VS       DLR i IronPython        Zaklju£ak

Zaklju£ak


         •   ozbiljan, dobro podrºan dinami£ki jezik na CLR-u i Monou


         •   vrlo solidan toolchain u razvoju
Python                 Python Tools for VS             DLR i IronPython   Zaklju£ak

Zaklju£ak


         •   ozbiljan, dobro podrºan dinami£ki jezik na CLR-u i Monou


         •   vrlo solidan toolchain u razvoju


         •   £emu sve to?

               •   brzi prototyping
               •   testiranje .NET assemblyja
               •   skriptiranje .NET i Silverlight aplikacija
Python      Python Tools for VS              DLR i IronPython   Zaklju£ak

Zaklju£ak


                Hvala na paºnji!

                                Nikola Pleji¢
                             nikola@plejic.com
                         http://nikola.plejic.com/

More Related Content

What's hot (20)

PPTX
Overview of Python - Bsides Detroit 2012
Tazdrumm3r
 
PDF
Python final ppt
Ripal Ranpara
 
PDF
Python Intro
Tim Penhey
 
PDF
Making the big data ecosystem work together with python apache arrow, spark,...
Holden Karau
 
PDF
Python indroduction
FEG
 
KEY
Programming with Python: Week 1
Ahmet Bulut
 
PDF
Powering tensorflow with big data (apache spark, flink, and beam) dataworks...
Holden Karau
 
PDF
Python 3.5: An agile, general-purpose development language.
Carlos Miguel Ferreira
 
PDF
A peek into Python's Metaclass and Bytecode from a Smalltalk User
Koan-Sin Tan
 
PDF
Python
Edureka!
 
PDF
Smalltalk and ruby - 2012-12-08
Koan-Sin Tan
 
PDF
Random Thoughts on Paper Implementations [KAIST 2018]
Taehoon Kim
 
PDF
What is Python? (Silicon Valley CodeCamp 2014)
wesley chun
 
PDF
Python教程 / Python tutorial
ee0703
 
PDF
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 
PDF
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Edureka!
 
PDF
Profiling and optimizing RAM and CPU use in RMG-Py
Richard West
 
PPT
Python Introduction
Mohammad Javad Beheshtian
 
PDF
Sharing (or stealing) the jewels of python with big data & the jvm (1)
Holden Karau
 
PPT
Python Introduction
Sofian Hadiwijaya
 
Overview of Python - Bsides Detroit 2012
Tazdrumm3r
 
Python final ppt
Ripal Ranpara
 
Python Intro
Tim Penhey
 
Making the big data ecosystem work together with python apache arrow, spark,...
Holden Karau
 
Python indroduction
FEG
 
Programming with Python: Week 1
Ahmet Bulut
 
Powering tensorflow with big data (apache spark, flink, and beam) dataworks...
Holden Karau
 
Python 3.5: An agile, general-purpose development language.
Carlos Miguel Ferreira
 
A peek into Python's Metaclass and Bytecode from a Smalltalk User
Koan-Sin Tan
 
Python
Edureka!
 
Smalltalk and ruby - 2012-12-08
Koan-Sin Tan
 
Random Thoughts on Paper Implementations [KAIST 2018]
Taehoon Kim
 
What is Python? (Silicon Valley CodeCamp 2014)
wesley chun
 
Python教程 / Python tutorial
ee0703
 
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Edureka!
 
Profiling and optimizing RAM and CPU use in RMG-Py
Richard West
 
Python Introduction
Mohammad Javad Beheshtian
 
Sharing (or stealing) the jewels of python with big data & the jvm (1)
Holden Karau
 
Python Introduction
Sofian Hadiwijaya
 

Viewers also liked (20)

ZIP
Logical Programming With ruby-prolog
Preston Lee
 
PPTX
Prolog -Cpt114 - Week3
a_akhavan
 
PPT
Introduction to XML
shannonsdavis
 
PDF
Part 1 picturebox using vb.net
Girija Muscut
 
PDF
Part 3 binding navigator vb.net
Girija Muscut
 
PDF
How Not To Be Seen
Mark Pesce
 
PPTX
Information Overload and Information Science / Mieczysław Muraszkiewicz
Zakład Systemów Informacyjnych, Instytut Informacji Naukowej i Studiów Bibliologicznych (UW)
 
PPTX
Presentation1
Liba Cheema
 
PPTX
Making Information Usable: The Art & Science of Information Design
Hubbard One
 
PDF
Transforming the world with Information technology
Glenn Klith Andersen
 
PPTX
Part 5 create sequence increment value using negative value
Girija Muscut
 
PPS
Vb.net session 15
Niit Care
 
PPTX
What’s new in Visual C++
Microsoft
 
PPTX
Part 8 add,update,delete records using records operation buttons in vb.net
Girija Muscut
 
PDF
Part2 database connection service based using vb.net
Girija Muscut
 
PPTX
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Wolfgang Stock
 
PPTX
Debugging in visual studio (basic level)
Larry Nung
 
PPTX
Cognitive information science
S. Kate Devitt
 
PDF
Cpp lab 13_pres
Youth For Peace
 
PDF
RuleML2015: Explanation of proofs of regulatory (non-)complianceusing semanti...
RuleML
 
Logical Programming With ruby-prolog
Preston Lee
 
Prolog -Cpt114 - Week3
a_akhavan
 
Introduction to XML
shannonsdavis
 
Part 1 picturebox using vb.net
Girija Muscut
 
Part 3 binding navigator vb.net
Girija Muscut
 
How Not To Be Seen
Mark Pesce
 
Information Overload and Information Science / Mieczysław Muraszkiewicz
Zakład Systemów Informacyjnych, Instytut Informacji Naukowej i Studiów Bibliologicznych (UW)
 
Presentation1
Liba Cheema
 
Making Information Usable: The Art & Science of Information Design
Hubbard One
 
Transforming the world with Information technology
Glenn Klith Andersen
 
Part 5 create sequence increment value using negative value
Girija Muscut
 
Vb.net session 15
Niit Care
 
What’s new in Visual C++
Microsoft
 
Part 8 add,update,delete records using records operation buttons in vb.net
Girija Muscut
 
Part2 database connection service based using vb.net
Girija Muscut
 
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Wolfgang Stock
 
Debugging in visual studio (basic level)
Larry Nung
 
Cognitive information science
S. Kate Devitt
 
Cpp lab 13_pres
Youth For Peace
 
RuleML2015: Explanation of proofs of regulatory (non-)complianceusing semanti...
RuleML
 
Ad

Recently uploaded (20)

PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Ad

Python Tools for Visual Studio: Python na Microsoftovom .NET-u

  • 1. Python Python Tools for VS DLR i IronPython Zaklju£ak Python Tools for Visual Studio Python na Microsoftovom .NET-u Nikola Pleji¢ [email protected] http://nikola.plejic.com DevUG Zagreb, 27.10.2011.
  • 3. Python Python Tools for VS DLR i IronPython Zaklju£ak Outline 1 Python Uvod Kratak vodi£ kroz jezik 2 Python Tools for VS Instalacija 3 DLR i IronPython Dynamic Language Runtime Uporaba IronPythona
  • 4. Python Python Tools for VS DLR i IronPython Zaklju£ak Python? > print(Hello, world!) Hello, world!
  • 5. Python Python Tools for VS DLR i IronPython Zaklju£ak Python? • op¢eniti, objektno-orijentirani high-level jezik
  • 6. Python Python Tools for VS DLR i IronPython Zaklju£ak Python? • op¢eniti, objektno-orijentirani high-level jezik • dinami£ki, strongly typed
  • 7. Python Python Tools for VS DLR i IronPython Zaklju£ak Python? • op¢eniti, objektno-orijentirani high-level jezik • dinami£ki, strongly typed • fokus na £itljivost i jednostavnost sintakse
  • 8. Python Python Tools for VS DLR i IronPython Zaklju£ak The Zen of Python import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Flat is better than nested. Sparse is better than dense. Readability counts. Special cases aren't special enough to break the rules. Although practicality beats purity. Errors should never pass silently. Unless explicitly silenced. In the face of ambiguity, refuse the temptation to guess. There should be one-- and preferably only one --obvious way to do it. Although that way may not be obvious at first unless you're Dutch. Now is better than never. Although never is often better than *right* now. If the implementation is hard to explain, it's a bad idea. If the implementation is easy to explain, it may be a good idea. Namespaces are one honking great idea -- let's do more of those!
  • 9. Python Python Tools for VS DLR i IronPython Zaklju£ak Kratka povijest • nastao krajem 1989. godine
  • 10. Python Python Tools for VS DLR i IronPython Zaklju£ak Kratka povijest • nastao krajem 1989. godine • Guido van Rossum (BDFL Benevolent Dictator For Life)
  • 11. Python Python Tools for VS DLR i IronPython Zaklju£ak Kratka povijest • nastao krajem 1989. godine • Guido van Rossum (BDFL Benevolent Dictator For Life) • Python 2 vs. Python 3
  • 12. Python Python Tools for VS DLR i IronPython Zaklju£ak Implementacije • referentna implementacija CPython
  • 13. Python Python Tools for VS DLR i IronPython Zaklju£ak Implementacije • referentna implementacija CPython • Jython, IronPython, PyPy
  • 14. Python Python Tools for VS DLR i IronPython Zaklju£ak Implementacije • referentna implementacija CPython • Jython, IronPython, PyPy • raznorazni kompajleri (Pyjamas, Pyrex, Cython)
  • 15. Python Python Tools for VS DLR i IronPython Zaklju£ak Osnovni tipovi podataka • sve je objekt
  • 16. Python Python Tools for VS DLR i IronPython Zaklju£ak Osnovni tipovi podataka • sve je objekt • string vs. unicode • ne i u IronPythonu (string == unicode)
  • 17. Python Python Tools for VS DLR i IronPython Zaklju£ak Osnovni tipovi podataka • sve je objekt • string vs. unicode • ne i u IronPythonu (string == unicode) • liste, tuplei
  • 18. Python Python Tools for VS DLR i IronPython Zaklju£ak Osnovni tipovi podataka • sve je objekt • string vs. unicode • ne i u IronPythonu (string == unicode) • liste, tuplei • dictionaries
  • 19. Python Python Tools for VS DLR i IronPython Zaklju£ak Comprehensions • list comprehensions
  • 20. Python Python Tools for VS DLR i IronPython Zaklju£ak Comprehensions • list comprehensions • dictionary comprehensions
  • 21. Python Python Tools for VS DLR i IronPython Zaklju£ak Comprehensions • list comprehensions • dictionary comprehensions • generatori • generator comprehensions
  • 22. Python Python Tools for VS DLR i IronPython Zaklju£ak Objektni model • klase
  • 23. Python Python Tools for VS DLR i IronPython Zaklju£ak Objektni model • klase • klase su objekti
  • 24. Python Python Tools for VS DLR i IronPython Zaklju£ak Objektni model • klase • klase su objekti • metaklase • [...] deeper magic than 99% of users should ever worry about. If you wonder whether you need them, you don't (the people who actually need them know with certainty that they need them, and don't need an explanation about why). ~ Tim Peters
  • 25. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to nam treba? • distribucija Pythona • standardni interpreter, ActiveState, IronPython, ... 1 http://pytools.codeplex.com/ 2 http://ipython.org/ 3 MSI na https://github.com/zeromq/pyzmq/downloads
  • 26. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to nam treba? • distribucija Pythona • standardni interpreter, ActiveState, IronPython, ... • Visual Studio ili besplatni Visual Studio Shell • ne i VS Express! 1 http://pytools.codeplex.com/ 2 http://ipython.org/ 3 MSI na https://github.com/zeromq/pyzmq/downloads
  • 27. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to nam treba? • distribucija Pythona • standardni interpreter, ActiveState, IronPython, ... • Visual Studio ili besplatni Visual Studio Shell • ne i VS Express! 1 • Python Tools for Visual Studio 1 http://pytools.codeplex.com/ 2 http://ipython.org/ 3 MSI na https://github.com/zeromq/pyzmq/downloads
  • 28. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to nam treba? • distribucija Pythona • standardni interpreter, ActiveState, IronPython, ... • Visual Studio ili besplatni Visual Studio Shell • ne i VS Express! 1 • Python Tools for Visual Studio 2 • IPython • alternativni (ne-samo-)Python shell • potreban pyzmq 2.1.4 3 1 http://pytools.codeplex.com/ 2 http://ipython.org/ 3 MSI na https://github.com/zeromq/pyzmq/downloads
  • 29. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to dobivamo? • IntelliSense 4 samo u VS Ultimate :(
  • 30. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to dobivamo? • IntelliSense • project management 4 samo u VS Ultimate :(
  • 31. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to dobivamo? • IntelliSense • project management • debugger 4 samo u VS Ultimate :(
  • 32. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to dobivamo? • IntelliSense • project management • debugger 4 • proling 4 samo u VS Ultimate :(
  • 33. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to je DLR? • skup libraryja nad CLR-om koji olak²ava hostanje dinami£kih jezika
  • 34. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to je DLR? • skup libraryja nad CLR-om koji olak²ava hostanje dinami£kih jezika • izvu£en iz ranih verzija IronPythona
  • 35. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to je DLR? • skup libraryja nad CLR-om koji olak²ava hostanje dinami£kih jezika • izvu£en iz ranih verzija IronPythona • zajedni£ka podloga za sve dinami£ke jezike na .NET-u (IronRuby, IronScheme)
  • 36. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to je DLR? • skup libraryja nad CLR-om koji olak²ava hostanje dinami£kih jezika • izvu£en iz ranih verzija IronPythona • zajedni£ka podloga za sve dinami£ke jezike na .NET-u (IronRuby, IronScheme) • pro²irenje postoje¢im stati£kim jezicima (dynamic dispatching @ C# 4.0)
  • 37. Python Python Tools for VS DLR i IronPython Zaklju£ak ’to je DLR? • skup libraryja nad CLR-om koji olak²ava hostanje dinami£kih jezika • izvu£en iz ranih verzija IronPythona • zajedni£ka podloga za sve dinami£ke jezike na .NET-u (IronRuby, IronScheme) • pro²irenje postoje¢im stati£kim jezicima (dynamic dispatching @ C# 4.0) • .NET Framework 4.0 + Mono 2.8+ po defaultu
  • 38. Python Python Tools for VS DLR i IronPython Zaklju£ak Kratka povijest IronPythona • Jim Hugunin, 2006.
  • 39. Python Python Tools for VS DLR i IronPython Zaklju£ak Kratka povijest IronPythona • Jim Hugunin, 2006. • danas: Microsoft (razvoj na CodePlexu)
  • 40. Python Python Tools for VS DLR i IronPython Zaklju£ak Kratka povijest IronPythona • Jim Hugunin, 2006. • danas: Microsoft (razvoj na CodePlexu) • open source (Apache 2.0)
  • 41. Python Python Tools for VS DLR i IronPython Zaklju£ak Kratka povijest IronPythona • Jim Hugunin, 2006. • danas: Microsoft (razvoj na CodePlexu) • open source (Apache 2.0) • aktivno razvijan (zadnji release: 21.10.2011.)
  • 42. Python Python Tools for VS DLR i IronPython Zaklju£ak Featurei • ≈ CPython 2.7 uz manje razlike, npr.: • string == unicode • Python podrºava vi²estruko naslježivanje, CLR ne podrºava
  • 43. Python Python Tools for VS DLR i IronPython Zaklju£ak Featurei • ≈ CPython 2.7 uz manje razlike, npr.: • string == unicode • Python podrºava vi²estruko naslježivanje, CLR ne podrºava • integracija s .NET frameworkom
  • 44. Python Python Tools for VS DLR i IronPython Zaklju£ak Featurei • ≈ CPython 2.7 uz manje razlike, npr.: • string == unicode • Python podrºava vi²estruko naslježivanje, CLR ne podrºava • integracija s .NET frameworkom • Silverlight scripting
  • 45. Python Python Tools for VS DLR i IronPython Zaklju£ak Pri£anje s .NET-om # deklaracija referenci import clr clr.AddReference(System.Xml) # namespacevi import System from System.Xml import * xmldoc = XmlDocument() # alternativno: # import system # xmldoc = System.Xml.XmlDocument()
  • 46. Python Python Tools for VS DLR i IronPython Zaklju£ak Pri£anje s .NET-om (smjer #2) 5 • DLR Hosting API (= free scripting!) 5 http://dlr.codeplex.com/wikipage?title=Docs%20and%20specsreferringTitle=Do
  • 47. Python Python Tools for VS DLR i IronPython Zaklju£ak Pri£anje s .NET-om (smjer #2) 5 • DLR Hosting API (= free scripting!) • kompajliranje IronPython aplikacije u .NET assembly • While the assemblies produced by the IronPython Hosting APIs are true .NET assemblies, the dynamic nature of the Python language makes it dicult to use these from other .NET languages. In short, this means that attempting to import Python types into other .NET languages such as C# is not recommended. 5 http://dlr.codeplex.com/wikipage?title=Docs%20and%20specsreferringTitle=Do
  • 48. Python Python Tools for VS DLR i IronPython Zaklju£ak ASP.NET i IronPython • WebForms uz ASP.NET Dynamic Language Support 6 http://github.com/jschementi/ironrubymvc
  • 49. Python Python Tools for VS DLR i IronPython Zaklju£ak ASP.NET i IronPython • WebForms uz ASP.NET Dynamic Language Support • ASP.NET MVC • http://www.codevoyeur.com/Articles/Tags/ironpython.aspx • Rubyja²i su bolje pro²li 6 6 http://github.com/jschementi/ironrubymvc
  • 50. Python Python Tools for VS DLR i IronPython Zaklju£ak Alternative 7 • Boo • sintaksa inspirirana Pythonom • stati£ki tipiziran (type inferencing) • makroi 7 http://boo.codehaus.org/ 8 http://ironruby.net/ 9 http://ironscheme.codeplex.com/
  • 51. Python Python Tools for VS DLR i IronPython Zaklju£ak Alternative 7 • Boo • sintaksa inspirirana Pythonom • stati£ki tipiziran (type inferencing) • makroi 8 • IronRuby 7 http://boo.codehaus.org/ 8 http://ironruby.net/ 9 http://ironscheme.codeplex.com/
  • 52. Python Python Tools for VS DLR i IronPython Zaklju£ak Alternative 7 • Boo • sintaksa inspirirana Pythonom • stati£ki tipiziran (type inferencing) • makroi 8 • IronRuby 9 • IronScheme? • skoro-pa-R6RS Scheme 7 http://boo.codehaus.org/ 8 http://ironruby.net/ 9 http://ironscheme.codeplex.com/
  • 53. Python Python Tools for VS DLR i IronPython Zaklju£ak Zaklju£ak • ozbiljan, dobro podrºan dinami£ki jezik na CLR-u i Monou
  • 54. Python Python Tools for VS DLR i IronPython Zaklju£ak Zaklju£ak • ozbiljan, dobro podrºan dinami£ki jezik na CLR-u i Monou • vrlo solidan toolchain u razvoju
  • 55. Python Python Tools for VS DLR i IronPython Zaklju£ak Zaklju£ak • ozbiljan, dobro podrºan dinami£ki jezik na CLR-u i Monou • vrlo solidan toolchain u razvoju • £emu sve to? • brzi prototyping • testiranje .NET assemblyja • skriptiranje .NET i Silverlight aplikacija
  • 56. Python Python Tools for VS DLR i IronPython Zaklju£ak Zaklju£ak Hvala na paºnji! Nikola Pleji¢ [email protected] http://nikola.plejic.com/