Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 3.97 KB

File metadata and controls

46 lines (30 loc) · 3.97 KB

Python (Language.Python)

Python has been implemented with the IronPython engine on the DLR.

Implementation / Compiler

Completeness

  • Syntax highlighting
  • Compilation
  • Execution
  • Console ouput
  • Return values
  • Diagnostics
  • Errors

Example code | Projects

About

You will need the Python standard library to use most of Python's features. IronPython libraries are already included (e.g.: clr).

You can get the Python standard library by downloading Python. (IronPython also offers the StdLib on NuGet (direct download) (See: importing libraries)

Globals

You can use the following Globals/Variables inside your code:

  • Random (object, .NET System.Random, msdn): Create random numbers with Random.Next(..)

  • Console (object, .NET System.IO.StringWriter, msdn): Write to Console with Console.WriteLine(string) or Console.Write(string)

  • CurrentThread (object, .NET System.Threading.Thread, msdn): The thread this got initialized on (mostly UI Thread), can be used to access all properties or functions from a System.Threading.Thread.

  • Editor (object, Fiddle Fiddle.UI.Editor (from System.Windows.Window, msdn)): Fiddle's Editor window, can be used to access all UIElements, properties, public functions or functions derived from System.Windows.Window. (Editor XAML code, Editor source code)

  • App (object, .NET System.Windows.Application, msdn): Fiddle's calling Application/App, can be used to access all properties or functions derived from System.Windows.Application)

  • RunUi(Action) (function, void Invoke(Action), declaration): A function with an anonymous function or Action as a parameter to execute code on the UI Thread. This is required for getting/setting properties or calling functions from Editor or App because those are not thread safe. Example:

RunUi(
    Editor.Hide
)

Properties

  • string pySearchPath: Python path for searching for libraries (also accessible via sys.path.append()). If empty, no libraries are imported.