Exemplo n.º 1
0
        /// <remarks>
        /// After the engine is created the standard output is replaced with our custom Stream class so we
        /// can redirect the stdout to the text editor window.
        /// This can be done in this method since the Runtime object will have been created before this method
        /// is called.
        /// </remarks>
        protected override IConsole CreateConsole(ScriptEngine engine, CommandLine commandLine, ConsoleOptions options)
        {
            var pythonOutputStream = new PythonOutputStream(textEditor);

            SetOutput(pythonOutputStream);
            pythonConsole = new PythonConsole(textEditor, commandLine);
            pythonOutputStream.TextWritten += pythonConsole.OutputWritten;
            if (ConsoleCreated != null)
            {
                ConsoleCreated(this, EventArgs.Empty);
            }
            return(pythonConsole);
        }
 protected virtual void SetOutput(PythonOutputStream stream)
 {
     Runtime.IO.SetOutput(stream, Encoding.UTF8);
 }
Exemplo n.º 3
0
 protected virtual void SetOutput(PythonOutputStream stream)
 {
     Runtime.IO.SetOutput(stream, Encoding.UTF8);
 }
Exemplo n.º 4
0
 private void SetOutput(PythonOutputStream stream)
 {
     Runtime.IO.SetOutput(stream, Encoding.UTF8);
 }