[IronPython] compiled "builtin" modules (os, sys, etc)

Dino Viehland dinov at microsoft.com
Thu Nov 13 18:08:19 CET 2008

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: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of oren at held.org.il
Sent: Thursday, November 13, 2008 1:39 AM
To: users at lists.ironpython.com
Subject: [IronPython] compiled "builtin" modules (os, sys, etc)


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?


 - Oren

Users mailing list
Users at lists.ironpython.com

More information about the Ironpython-users mailing list