Python has been implemented with the IronPython engine on the DLR.
- Syntax highlighting
- Compilation
- Execution
- Console ouput
- Return values
- Diagnostics
- Errors
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)
You can use the following Globals/Variables inside your code:
-
Random(object, .NETSystem.Random, msdn): Create random numbers withRandom.Next(..) -
Console(object, .NETSystem.IO.StringWriter, msdn): Write to Console withConsole.WriteLine(string)orConsole.Write(string) -
CurrentThread(object, .NETSystem.Threading.Thread, msdn): The thread this got initialized on (mostly UI Thread), can be used to access all properties or functions from aSystem.Threading.Thread. -
Editor(object, FiddleFiddle.UI.Editor(fromSystem.Windows.Window, msdn)): Fiddle's Editor window, can be used to access allUIElements, properties, public functions or functions derived fromSystem.Windows.Window. (Editor XAML code, Editor source code) -
App(object, .NETSystem.Windows.Application, msdn): Fiddle's callingApplication/App, can be used to access all properties or functions derived fromSystem.Windows.Application) -
RunUi(Action)(function,void Invoke(Action), declaration): A function with an anonymous function orActionas a parameter to execute code on the UI Thread. This is required for getting/setting properties or calling functions fromEditororAppbecause those are not thread safe. Example:
RunUi(
Editor.Hide
)string pySearchPath: Python path for searching for libraries (also accessible via sys.path.append()). If empty, no libraries are imported.