Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
Letzte Überarbeitung Beide Seiten der Revision
en:chapter1 [2018/10/28 11:00]
hlinke
en:chapter1 [2019/06/10 15:36]
hlinke [Access to VEGAS]
Zeile 1: Zeile 1:
-====== VEGASPython ====== +====== VEGASPython Tutorial ======
- +
  
-===== VEGASPython Tutorial =====+===== Chapter 1 Introduction to VEGASPython Scripting =====
  
-==== Chapter 1 Introduction to VEGASPython Scripting ==== +==== Introduction ====
- +
-=== Introduction ===+
 VEGAS is one of the few video editing applications that provide an open interface to add functionality to the application. VEGAS is one of the few video editing applications that provide an open interface to add functionality to the application.
 The VEGAS scripting interface is based on a programming platform from Microsoft called .NET. The VEGAS scripting interface is based on a programming platform from Microsoft called .NET.
Zeile 20: Zeile 17:
 Python is used in many application domains including: Web and Internet Development,Scientific apps,Desktop apps, education, general software applications and Video Scripting. Python is used in many application domains including: Web and Internet Development,Scientific apps,Desktop apps, education, general software applications and Video Scripting.
  
-You can find more detail son Python on the official website: [[http://Python.org|Python.org]].+You can find more details about Python on the official website: [[http://Python.org|Python.org]].
 For historical reasons there are two versions of Python language avilable: Python 2.x and Python 3.x. Unfortunately Python 3.x includes a lot of incvompatible changes to the Python language so that version 2.x has still to be maintained, as a lot of solutions are based on this version For historical reasons there are two versions of Python language avilable: Python 2.x and Python 3.x. Unfortunately Python 3.x includes a lot of incvompatible changes to the Python language so that version 2.x has still to be maintained, as a lot of solutions are based on this version
 VEGASPython is also based on Python 2.x. VEGASPython is also based on Python 2.x.
  
-Several different Python implementations are available CPython, JPython etcThen orginal version is called CPython as it is written in the programming language "C".+PythonNet: Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers. It allows Python code to interact with the CLR, and may also be used to embed Python into a .NET application.
  
-VEGASPython is based on a Pythonimplementation called IRONPython. IronPython is an open source implementation of Python for .NET. The development had been started by Microsoft but is now given to an open community that is still active and provides regularly new updated versions of IRONPython.+Several different Python implementations are available CPython, JPython etc. The orginal version is called CPython as it is written in the programming language "C".
  
-The current version (in 2018) is 2.7.9. At the moment the comunity is working on a new version that supports Python 3.x scripts.+VEGASPython is based on a PythonNetPythonNet is an extension of CPython and therefore compatible with all Cpython extension modules.
  
-If you want to know more about IRONPython you can get more information on the official website [[http://ironpython.net/|ironpython.net/]].+An older version of VEGASPythion was based on IronPython. IronPython is an open source implementation of Python for .NET. The development had been started by Microsoft but is now given to an open community that is still active and provides regularly new updated versions of IRONPython. 
 +If you want to know more about IRONPython you can get more information on the official website [[http://ironpython.net/|ironpython.net/]].Very good and detailed information about IRONPython can be found in the book "IronPython in Action" by Michael J. Foord and Christian Muirhead. Here is the link to the homepage: [[http://www.ironpythoninaction.com/|www.ironpythoninaction.com/]] 
 +The main problem of IRONPython is the incompatibility with several standard Python moduels like openCV and NumPy. Especially openCV is interesting for Video editing.
  
-Very good and detailed information about IRONPython can be found in the book "IronPython in Action" by Michael JFoord and Christian MuirheadHere is the link to the homepage: [[http://www.ironpythoninaction.com/|www.ironpythoninaction.com/]]+Python for .NET is a package that gives Python programmers nearly seamless integration with the .NET Common Language Runtime (CLR) and provides a powerful application scripting tool for .NET developers. It allows Python code to interact with the CLR, and may also be used to embed Python into a .NET application.
  
-=== Hello World ===+ 
 +==== Hello World ====
 Nearly all programming tutorials start with the so called "Hello World" program. This is a very simple program that provide the text "Hello World" as an output. Nearly all programming tutorials start with the so called "Hello World" program. This is a very simple program that provide the text "Hello World" as an output.
  
Zeile 44: Zeile 44:
 I assume that you have installed VEGASPython accoriding to the installation description - [[en:vegas_python_download|VEGASPython Download and Installation]] I assume that you have installed VEGASPython accoriding to the installation description - [[en:vegas_python_download|VEGASPython Download and Installation]]
  
-== the interactive VEGASPython Window ==+=== the interactive VEGASPython Window ===
 We will start using the interactive VEGASPython window it allows a very fast and easy Python script creation and execution. We will start using the interactive VEGASPython window it allows a very fast and easy Python script creation and execution.
  
Zeile 65: Zeile 65:
 The VEGASPython window can float over the VEGAS UI or can be docked into the user interface like all other VEGAS windows. The VEGASPython window can float over the VEGAS UI or can be docked into the user interface like all other VEGAS windows.
  
-== The program ==+=== The program ===
 In VEGASPython the standard "Hello World" script is very easy: In VEGASPython the standard "Hello World" script is very easy:
  
 Enter:  Enter: 
 <code python> <code python>
-print("Hello World")+print ("Hello World")
 </code> </code>
  
Zeile 76: Zeile 76:
 The text "Hello World" will be printed into the Output textbox. The text "Hello World" will be printed into the Output textbox.
  
-The result should look similar as in the image below. 
- 
-{{:en:vegaspython08a.jpg?direct&400|}} 
  
 If you did something wrong then you will see an error message in the Output textbox. If you did something wrong then you will see an error message in the Output textbox.
Zeile 84: Zeile 81:
 When you mastered this script then you have already mastered a big step to be able to write VEGASPython scripts. When you mastered this script then you have already mastered a big step to be able to write VEGASPython scripts.
  
-=== Introduction to the Python Language === +==== Introduction to the Python Language ==== 
-It is not the intention of this tutorial is to provide a complete Python tutorial. I will only show you the items you need to know to be able to create or modify VEGASPython scripts.+It is not the intention of this tutorial to provide a complete Python tutorial. I will only show you the items you need to know to be able to create or modify VEGASPython scripts
 +VEGASPython is based on Python 3.x. Therefore the Python 3 syntax has to be used.
  
-== Functions ==+=== Functions ===
 In the Hello World script we saw already two important concepts of Python: functions and strings. In the Hello World script we saw already two important concepts of Python: functions and strings.
  
-**print()** is a function that is build into Python and print text into the output textbox.+**print** is a function that is build into Python and print text into the output textbox.
  
 A lot of functions are already included in Python. But you can also define your own functions and you import functions from so called libraries. We will cover this later. A lot of functions are already included in Python. But you can also define your own functions and you import functions from so called libraries. We will cover this later.
Zeile 109: Zeile 107:
  
  
-== Variables ==+=== Variables ===
 In addition to function you also need variables to store information. In addition to function you also need variables to store information.
 A variable has a name, a datatype and a value. A variable has a name, a datatype and a value.
Zeile 118: Zeile 116:
   * If you create a variable x, x = 3, then Python assumes its an integer.    * If you create a variable x, x = 3, then Python assumes its an integer. 
   * If you assign x = 1.5 then Python knows its not an integer but floating point number.   * If you assign x = 1.5 then Python knows its not an integer but floating point number.
- 
-You can even change the datatype by assigning a new value - but this is not recommended. 
  
 Please try this: Please try this:
 <code Python> <code Python>
-x=5 +numberVariable = 5 
-print(x+print (numberVariable
-x=0.5 +floatVariable = 0.5 
-print(x+print (floatVariable
-x="Number 5" +stringVariable = "Number 5" 
-print (x)+print (stringVariable)
 </code> </code>
  
-This is a big difference to most other programming languages where you ahev to define the datatype of all variables before you can use them.+This is a big difference to most other programming languages where you have to define the datatype of all variables before you can use them. 
 = Variable naming = = Variable naming =
 A variable name must begin with a letter (upper or lower case) or an underscore.  A variable name must begin with a letter (upper or lower case) or an underscore. 
-Variables cannot start with a number and are case sensitive. +Variables cannot start with a number and are case sensitive. The variables x and X are different variables.
- +
-The names are case sensitive. The variables x and X are different variables.+
  
 By convention variables are often camel cased, meaning the first letter is small and the next words are all capital. By convention variables are often camel cased, meaning the first letter is small and the next words are all capital.
Zeile 154: Zeile 149:
  
  
-=== Access to VEGAS ===+==== Access to VEGAS ====
 Already with the few items we have seen of Python in this chapter we can already access the VEGAS application. Already with the few items we have seen of Python in this chapter we can already access the VEGAS application.
  
Zeile 162: Zeile 157:
  
 pyVEGAS has the datatype "Vegas". "Vegas" is a predefined datatype from the "Vegas Pro Scripting API". We will discuss the "Vegas Pro Scripting API" in a later chapter. pyVEGAS has the datatype "Vegas". "Vegas" is a predefined datatype from the "Vegas Pro Scripting API". We will discuss the "Vegas Pro Scripting API" in a later chapter.
 +
 For now you only have to know that the datatype "Vegas" has a property "Version". Version is of type string. For now you only have to know that the datatype "Vegas" has a property "Version". Version is of type string.
  
Zeile 169: Zeile 165:
  
 <code python> <code python>
-print(pyVEGAS.Version)+print (pyVEGAS.Version)
 </code> </code>
  
 This command prints the current version of VEGAS into the Output textbox: Version 16.0 (Build 261). This command prints the current version of VEGAS into the Output textbox: Version 16.0 (Build 261).
- 
-{{:en:vegaspython11a.jpg?direct&400|}} 
  
 == Conclusion === == Conclusion ===

Andere Sprachen
QR-Code
QR-Code en:chapter1 (erstellt für aktuelle Seite)