public PythonObject(Stream pythonSourceCodeStream, PythonEntityType entityType) { _entityType = entityType; byte[] codeBytes = new byte[pythonSourceCodeStream.Length]; pythonSourceCodeStream.Read(codeBytes, 0, codeBytes.Length); _sourceCode = Encoding.UTF8.GetString(codeBytes); _scriptEngine = Python.CreateEngine(); FromSourceCode(_sourceCode); pythonSourceCodeStream.Close(); }
public PythonObject(string sourceCode, PythonEntityType entityType) { _entityType = entityType; _scriptEngine = Python.CreateEngine(); FromSourceCode(sourceCode); }