[IronPython] Importing embedded .py files

Szymon Kobalczyk s.kobalczyk at softwaremind.pl
Mon Jul 3 07:40:36 PDT 2006


JoeSox napisał(a):
> I can get the resources as a string so I'll have to play around with
> that. Thanks good idea.
>   

Hi,
 From the source code I can see that the FromFile method on Parser class 
reads the file contents to byte array and later uses MemoryStream to 
create StreamReader for actual parsing. You can easily generalize this 
code to extract a FromStream method and then surface it to the 
PythonEngine API.
If you have this you can easily read the file from a resource stream.

Szymon Kobalczyk



More information about the users mailing list