[Ironpython-users] Recreate and compile a script in an existing engine instance?

Markus Schaber m.schaber at codesys.com
Mon Jul 14 09:58:43 CEST 2014


Von: Andrew Stephens
> In C# I’m loading and compiling a script like this:-
>           _engine = Python.CreateEngine();
>           _scope = _engine.CreateScope();
>           _scriptSource = _engine.CreateScriptSourceFromFile(filename, Encoding.UTF7, SourceCodeKind.Statements);
>           _compiledScript = _scriptSource.Compile();
> (At some point in time my application will run the script by calling _compiledScript.Execute(_scope).)

Just as a side question out of curiosity: Are you really using UTF7 encoding? Are you constrained to ASCII?

Best regards

Markus Schaber

CODESYS® a trademark of 3S-Smart Software Solutions GmbH 

Inspiring Automation Solutions 
3S-Smart Software Solutions GmbH 
Dipl.-Inf. Markus Schaber | Product Development Core Technology 
Memminger Str. 151 | 87439 Kempten | Germany 
Tel. +49-831-54031-979 | Fax +49-831-54031-50 

E-Mail: m.schaber at codesys.com | Web: codesys.com | CODESYS store: store.codesys.com 
CODESYS forum: forum.codesys.com 

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner | Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915 
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received 
this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure 
or distribution of the material in this e-mail is strictly forbidden. 

More information about the Ironpython-users mailing list