[Edu-sig] Bootable Python CDs?
Ian Bicking
ianb at colorstudy.com
Fri Apr 28 01:31:29 CEST 2006
David Boddie wrote:
> On Thu Apr 27 17:47:15 CEST 2006, Ian Bicking wrote:
>
>
>>For something a bit more sophisticated, this is a good argument for
>>importing from URLs. Not inlined into the code, but if you added say
>>'http://svn.classsite.com/repos/student-name' to sys.path, and an import
>>hook that knew how to read such sites (I think both importing from svn
>>and plain HTTP are possible, since you don't have to do a listdir to
>>attempt an import).
>
>
> HTTP isn't too hard. I wrote an import hook to do this a few years ago:
>
> http://www.boddie.org.uk/python/xhtmlhook/
>
> Of course, it does other things besides import .py files over HTTP, but
> it shows that it can be done.
>
> These days it could be implemented more cleanly using the improved import
> hook mechanism.
You are right, that wasn't hard at all:
http://svn.colorstudy.com/home/ianb/httpimport.py
I haven't tested this seriously, and I'm not sure about the performance.
Mmm... data loading also fits in.
--
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Edu-sig
mailing list