This is the script I used for compiling the standard library:

import clr
import System


def get_files(dir):
    if 'lib-tk' in dir: return ()
    if '.\\test' in dir: return ()

    res = [file for file in System.IO.Directory.GetFiles(dir, '*.py')]
    dirs = System.IO.Directory.GetDirectories(dir)
    if dirs:
        for dir in dirs:
            res += get_files(dir)
    return res

files = get_files('.')

clr.CompileModules('all.dll', *files)

Note you'll also want to exclude socket.py or rename it in the standard library 
dir (we're not going to ship socket w/ the final version of IronPython as we 
have a built-in socket).

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Thursday, November 13, 2008 1:39 AM
To: users@lists.ironpython.com
Subject: [IronPython] compiled "builtin" modules (os, sys, etc)

Hi,

This question is regarding IronPythong *compiled* code (I use pyc.py):

It seems that I have to "compile" even the "builtin" modules such as sys,
os, if my script imports them.

1. Aren't they supposed to be included in IronPython.dll? Am I doing
something wrong? :)
2. Do you know of any "make" script that follows all the imported modules
recursively and compiles them as well?

Thanks!

 - Oren

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to