Vineet Jain (gmail) wrote: > > I’m building my first silverlight application and wanted to use a good > templating library (preppy from reportlab > http://www.reportlab.org/downloads.html ) in ironpython. The main > problem that I’m having now is with > > import py_compile > > py_compile.compile(srcFileName, > > cfile=directory + os.sep + name + '.pyc', > > dfile=name + '.py') > > When I try to import py_compile from python it fails. Is there any way > to compile and load a python source file from a text string and not > have to save the file to the filesystem? >
I'm not familiar with preppy - but IronPython doesn't support loading or saving compiled Python bytecode files (IronPython uses a different bytecode format altogether). You also can't write to the filesystem from Silverlight. You can read files that are contained in the '.xap' file (your dynamic application) - but you have to use 'file' rather than 'open'. I'm afraid you will actually have to dig into "py_compile.compile" to see if there is a workaround what it is trying to do. Michael Foord http://www.ironpythoninaction.com/ > Thanks, > > Vineet > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > [email protected] > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > _______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
