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

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/
1 of 56

Recommended

Python for Science and Engineering: a presentation to A*STAR and the Singapor... by
Python for Science and Engineering: a presentation to A*STAR and the Singapor...Python for Science and Engineering: a presentation to A*STAR and the Singapor...
Python for Science and Engineering: a presentation to A*STAR and the Singapor...pythoncharmers
7K views89 slides
Intro to Python Workshop San Diego, CA (January 19, 2013) by
Intro to Python Workshop San Diego, CA (January 19, 2013)Intro to Python Workshop San Diego, CA (January 19, 2013)
Intro to Python Workshop San Diego, CA (January 19, 2013)Kendall
1.8K views78 slides
Phosphor: Illuminating Dynamic Data Flow in Commodity JVMs by
Phosphor: Illuminating Dynamic Data Flow in Commodity JVMsPhosphor: Illuminating Dynamic Data Flow in Commodity JVMs
Phosphor: Illuminating Dynamic Data Flow in Commodity JVMsjon_bell
1.5K views38 slides
Ry pyconjp2015 karaoke by
Ry pyconjp2015 karaokeRy pyconjp2015 karaoke
Ry pyconjp2015 karaokeRenyuan Lyu
12.5K views37 slides
Welcome to Python by
Welcome to PythonWelcome to Python
Welcome to PythonElena Williams
737 views21 slides
Getting started with Linux and Python by Caffe by
Getting started with Linux and Python by CaffeGetting started with Linux and Python by Caffe
Getting started with Linux and Python by CaffeLihang Li
15.4K views65 slides

More Related Content

What's hot

Overview of Python - Bsides Detroit 2012 by
Overview of Python - Bsides Detroit 2012Overview of Python - Bsides Detroit 2012
Overview of Python - Bsides Detroit 2012Tazdrumm3r
5K views87 slides
Python final ppt by
Python final pptPython final ppt
Python final pptRipal Ranpara
53K views71 slides
Python Intro by
Python IntroPython Intro
Python IntroTim Penhey
3.4K views58 slides
Making the big data ecosystem work together with python apache arrow, spark,... by
Making the big data ecosystem work together with python  apache arrow, spark,...Making the big data ecosystem work together with python  apache arrow, spark,...
Making the big data ecosystem work together with python apache arrow, spark,...Holden Karau
85 views64 slides
Python indroduction by
Python indroductionPython indroduction
Python indroductionFEG
95 views35 slides
Programming with Python: Week 1 by
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1Ahmet Bulut
442 views39 slides

What's hot(20)

Overview of Python - Bsides Detroit 2012 by Tazdrumm3r
Overview of Python - Bsides Detroit 2012Overview of Python - Bsides Detroit 2012
Overview of Python - Bsides Detroit 2012
Tazdrumm3r5K views
Python Intro by Tim Penhey
Python IntroPython Intro
Python Intro
Tim Penhey3.4K views
Making the big data ecosystem work together with python apache arrow, spark,... by Holden Karau
Making the big data ecosystem work together with python  apache arrow, spark,...Making the big data ecosystem work together with python  apache arrow, spark,...
Making the big data ecosystem work together with python apache arrow, spark,...
Holden Karau85 views
Python indroduction by FEG
Python indroductionPython indroduction
Python indroduction
FEG95 views
Programming with Python: Week 1 by Ahmet Bulut
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
Ahmet Bulut442 views
Powering tensorflow with big data (apache spark, flink, and beam) dataworks... by Holden Karau
Powering tensorflow with big data (apache spark, flink, and beam)   dataworks...Powering tensorflow with big data (apache spark, flink, and beam)   dataworks...
Powering tensorflow with big data (apache spark, flink, and beam) dataworks...
Holden Karau44 views
A peek into Python's Metaclass and Bytecode from a Smalltalk User by Koan-Sin Tan
A peek into Python's Metaclass and Bytecode from a Smalltalk UserA peek into Python's Metaclass and Bytecode from a Smalltalk User
A peek into Python's Metaclass and Bytecode from a Smalltalk User
Koan-Sin Tan5.6K views
Python by Edureka!
Python Python
Python
Edureka!3.3K views
Smalltalk and ruby - 2012-12-08 by Koan-Sin Tan
Smalltalk and ruby  - 2012-12-08Smalltalk and ruby  - 2012-12-08
Smalltalk and ruby - 2012-12-08
Koan-Sin Tan1.8K views
Random Thoughts on Paper Implementations [KAIST 2018] by Taehoon Kim
Random Thoughts on Paper Implementations [KAIST 2018]Random Thoughts on Paper Implementations [KAIST 2018]
Random Thoughts on Paper Implementations [KAIST 2018]
Taehoon Kim119.8K views
What is Python? (Silicon Valley CodeCamp 2014) by wesley chun
What is Python? (Silicon Valley CodeCamp 2014)What is Python? (Silicon Valley CodeCamp 2014)
What is Python? (Silicon Valley CodeCamp 2014)
wesley chun1.5K views
Python教程 / Python tutorial by ee0703
Python教程 / Python tutorialPython教程 / Python tutorial
Python教程 / Python tutorial
ee0703639 views
What is Python? (Silicon Valley CodeCamp 2015) by wesley chun
What is Python? (Silicon Valley CodeCamp 2015)What is Python? (Silicon Valley CodeCamp 2015)
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun1.1K views
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin... by Edureka!
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Edureka!2.2K views
Profiling and optimizing RAM and CPU use in RMG-Py by Richard West
Profiling and optimizing RAM and CPU use in RMG-PyProfiling and optimizing RAM and CPU use in RMG-Py
Profiling and optimizing RAM and CPU use in RMG-Py
Richard West633 views
Sharing (or stealing) the jewels of python with big data & the jvm (1) by Holden Karau
Sharing (or stealing) the jewels of python with big data & the jvm (1)Sharing (or stealing) the jewels of python with big data & the jvm (1)
Sharing (or stealing) the jewels of python with big data & the jvm (1)
Holden Karau53 views

Viewers also liked

Logical Programming With ruby-prolog by
Logical Programming With ruby-prologLogical Programming With ruby-prolog
Logical Programming With ruby-prologPreston Lee
3.7K views12 slides
Prolog -Cpt114 - Week3 by
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3a_akhavan
786 views50 slides
Introduction to XML by
Introduction to XMLIntroduction to XML
Introduction to XMLshannonsdavis
605 views36 slides
Part 1 picturebox using vb.net by
Part 1 picturebox using vb.netPart 1 picturebox using vb.net
Part 1 picturebox using vb.netGirija Muscut
777 views4 slides
Part 3 binding navigator vb.net by
Part 3 binding navigator vb.netPart 3 binding navigator vb.net
Part 3 binding navigator vb.netGirija Muscut
1.3K views20 slides
How Not To Be Seen by
How Not To Be SeenHow Not To Be Seen
How Not To Be SeenMark Pesce
813 views64 slides

Viewers also liked(20)

Logical Programming With ruby-prolog by Preston Lee
Logical Programming With ruby-prologLogical Programming With ruby-prolog
Logical Programming With ruby-prolog
Preston Lee3.7K views
Prolog -Cpt114 - Week3 by a_akhavan
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3
a_akhavan786 views
Part 1 picturebox using vb.net by Girija Muscut
Part 1 picturebox using vb.netPart 1 picturebox using vb.net
Part 1 picturebox using vb.net
Girija Muscut777 views
Part 3 binding navigator vb.net by Girija Muscut
Part 3 binding navigator vb.netPart 3 binding navigator vb.net
Part 3 binding navigator vb.net
Girija Muscut1.3K views
How Not To Be Seen by Mark Pesce
How Not To Be SeenHow Not To Be Seen
How Not To Be Seen
Mark Pesce813 views
Making Information Usable: The Art & Science of Information Design by Hubbard One
Making Information Usable: The Art & Science of Information DesignMaking Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information Design
Hubbard One948 views
Transforming the world with Information technology by Glenn Klith Andersen
Transforming the world with Information technologyTransforming the world with Information technology
Transforming the world with Information technology
Part 5 create sequence increment value using negative value by Girija Muscut
Part 5 create sequence increment value using negative valuePart 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative value
Girija Muscut288 views
Vb.net session 15 by Niit Care
Vb.net session 15Vb.net session 15
Vb.net session 15
Niit Care1.1K views
Introduction to Science and Its Information Sources by Kristy Padron
Introduction to Science and Its Information SourcesIntroduction to Science and Its Information Sources
Introduction to Science and Its Information Sources
Kristy Padron1K views
What’s new in Visual C++ by Microsoft
What’s new in Visual C++What’s new in Visual C++
What’s new in Visual C++
Microsoft1K views
Part 8 add,update,delete records using records operation buttons in vb.net by Girija Muscut
Part 8 add,update,delete records using records operation buttons in vb.netPart 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.net
Girija Muscut439 views
Part2 database connection service based using vb.net by Girija Muscut
Part2 database connection service based using vb.netPart2 database connection service based using vb.net
Part2 database connection service based using vb.net
Girija Muscut1.2K views
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs by Wolfgang Stock
Pioneers of Information Science in Europe: The Oeuvre of Norbert HenrichsPioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Wolfgang Stock1.7K views
Debugging in visual studio (basic level) by Larry Nung
Debugging in visual studio (basic level)Debugging in visual studio (basic level)
Debugging in visual studio (basic level)
Larry Nung1K views
Cognitive information science by S. Kate Devitt
Cognitive information scienceCognitive information science
Cognitive information science
S. Kate Devitt595 views

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

Python Programming1.ppt by
Python Programming1.pptPython Programming1.ppt
Python Programming1.pptRehnawilson1
18 views99 slides
Introduction to Python – Learn Python Programming.pptx by
Introduction to Python – Learn Python Programming.pptxIntroduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptxHassanShah396906
10 views10 slides
python presntation 2.pptx by
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptxArpittripathi45
190 views38 slides
Violent python by
Violent pythonViolent python
Violent pythonXatierlike Lee
778 views22 slides
Intro to Python for C# Developers by
Intro to Python for C# DevelopersIntro to Python for C# Developers
Intro to Python for C# DevelopersSarah Dutkiewicz
600 views37 slides
PL/Parrot San Francisco Perl Mongers 2010/05/25 by
PL/Parrot San Francisco Perl Mongers 2010/05/25PL/Parrot San Francisco Perl Mongers 2010/05/25
PL/Parrot San Francisco Perl Mongers 2010/05/25David Fetter
727 views78 slides

Similar to Python Tools for Visual Studio: Python na Microsoftovom .NET-u(20)

Python Programming1.ppt by Rehnawilson1
Python Programming1.pptPython Programming1.ppt
Python Programming1.ppt
Rehnawilson118 views
Introduction to Python – Learn Python Programming.pptx by HassanShah396906
Introduction to Python – Learn Python Programming.pptxIntroduction to Python – Learn Python Programming.pptx
Introduction to Python – Learn Python Programming.pptx
HassanShah39690610 views
PL/Parrot San Francisco Perl Mongers 2010/05/25 by David Fetter
PL/Parrot San Francisco Perl Mongers 2010/05/25PL/Parrot San Francisco Perl Mongers 2010/05/25
PL/Parrot San Francisco Perl Mongers 2010/05/25
David Fetter727 views
Introduction to Analytics with Azure Notebooks and Python by Jen Stirrup
Introduction to Analytics with Azure Notebooks and PythonIntroduction to Analytics with Azure Notebooks and Python
Introduction to Analytics with Azure Notebooks and Python
Jen Stirrup318 views
A Whirlwind Tour Of Python by Asia Smith
A Whirlwind Tour Of PythonA Whirlwind Tour Of Python
A Whirlwind Tour Of Python
Asia Smith5 views
开源沙龙第一期 Python intro by fantasy zheng
开源沙龙第一期 Python intro开源沙龙第一期 Python intro
开源沙龙第一期 Python intro
fantasy zheng304 views
SoC Python Discussion Group by krishna_dubba
SoC Python Discussion GroupSoC Python Discussion Group
SoC Python Discussion Group
krishna_dubba391 views
Python_Introduction_Good_PPT.pptx by lemonchoos
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
lemonchoos28 views
Perl::Lint - Yet Another Perl Source Code Linter by moznion
Perl::Lint - Yet Another Perl Source Code LinterPerl::Lint - Yet Another Perl Source Code Linter
Perl::Lint - Yet Another Perl Source Code Linter
moznion3.3K views
Python Foundation – A programmer's introduction to Python concepts & style by Kevlin Henney
Python Foundation – A programmer's introduction to Python concepts & stylePython Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & style
Kevlin Henney6.8K views
Tutorial on-python-programming by Chetan Giridhar
Tutorial on-python-programmingTutorial on-python-programming
Tutorial on-python-programming
Chetan Giridhar1.4K views
20120524 english lt2_pythontoolsfortesting by Kazuhiro Oinuma
20120524 english lt2_pythontoolsfortesting20120524 english lt2_pythontoolsfortesting
20120524 english lt2_pythontoolsfortesting
Kazuhiro Oinuma1.2K views

Recently uploaded

handbook for web 3 adoption.pdf by
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdfLiveplex
19 views16 slides
The Importance of Cybersecurity for Digital Transformation by
The Importance of Cybersecurity for Digital TransformationThe Importance of Cybersecurity for Digital Transformation
The Importance of Cybersecurity for Digital TransformationNUS-ISS
27 views26 slides
Report 2030 Digital Decade by
Report 2030 Digital DecadeReport 2030 Digital Decade
Report 2030 Digital DecadeMassimo Talia
14 views41 slides
STPI OctaNE CoE Brochure.pdf by
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdfmadhurjyapb
12 views1 slide
Attacking IoT Devices from a Web Perspective - Linux Day by
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day Simone Onofri
15 views68 slides
Future of Learning - Khoong Chan Meng by
Future of Learning - Khoong Chan MengFuture of Learning - Khoong Chan Meng
Future of Learning - Khoong Chan MengNUS-ISS
33 views7 slides

Recently uploaded(20)

handbook for web 3 adoption.pdf by Liveplex
handbook for web 3 adoption.pdfhandbook for web 3 adoption.pdf
handbook for web 3 adoption.pdf
Liveplex19 views
The Importance of Cybersecurity for Digital Transformation by NUS-ISS
The Importance of Cybersecurity for Digital TransformationThe Importance of Cybersecurity for Digital Transformation
The Importance of Cybersecurity for Digital Transformation
NUS-ISS27 views
STPI OctaNE CoE Brochure.pdf by madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb12 views
Attacking IoT Devices from a Web Perspective - Linux Day by Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri15 views
Future of Learning - Khoong Chan Meng by NUS-ISS
Future of Learning - Khoong Chan MengFuture of Learning - Khoong Chan Meng
Future of Learning - Khoong Chan Meng
NUS-ISS33 views
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor... by Vadym Kazulkin
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
How to reduce cold starts for Java Serverless applications in AWS at JCON Wor...
Vadym Kazulkin75 views
Transcript: The Details of Description Techniques tips and tangents on altern... by BookNet Canada
Transcript: The Details of Description Techniques tips and tangents on altern...Transcript: The Details of Description Techniques tips and tangents on altern...
Transcript: The Details of Description Techniques tips and tangents on altern...
BookNet Canada130 views
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu... by NUS-ISS
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
Architecting CX Measurement Frameworks and Ensuring CX Metrics are fit for Pu...
NUS-ISS37 views
Voice Logger - Telephony Integration Solution at Aegis by Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma17 views
RADIUS-Omnichannel Interaction System by RADIUS
RADIUS-Omnichannel Interaction SystemRADIUS-Omnichannel Interaction System
RADIUS-Omnichannel Interaction System
RADIUS15 views
Perth MeetUp November 2023 by Michael Price
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023
Michael Price15 views
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze by NUS-ISS
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng TszeDigital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
Digital Product-Centric Enterprise and Enterprise Architecture - Tan Eng Tsze
NUS-ISS19 views
[2023] Putting the R! in R&D.pdf by Eleanor McHugh
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
Eleanor McHugh38 views
AI: mind, matter, meaning, metaphors, being, becoming, life values by Twain Liu 刘秋艳
AI: mind, matter, meaning, metaphors, being, becoming, life valuesAI: mind, matter, meaning, metaphors, being, becoming, life values
AI: mind, matter, meaning, metaphors, being, becoming, life values

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¢ nikola@plejic.com 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¢ nikola@plejic.com http://nikola.plejic.com/