Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can Python be run off of a CD-ROM?

7 views
Skip to first unread message

BJ MacNevin

unread,
Dec 2, 2003, 12:19:29 AM12/2/03
to
Hi all,

I teach middle school and am currently trying to bring some computer science
to the students. Our district has a wonderfully linked network throughout
all our schools... done via MS Windows Network. In order to protect the
network, our district's IT department does not want things installed on the
system (or at least makes it VERY difficult to get it done). SO, I am using
MSW Logo installed onto a CD-ROM... we just stick in the CD-ROMS and run it
off of them.

BUT, I am learning about Python and think it is TERRIFIC! So I wonder if I
can do the same thing... or something similar? Is there a way to install
Python on a CD-ROM, too, if we don't need it to be accessed from a command
prompt?

Thanks,
BJ MacNevin

--
_______________________________
I didn't say it was your fault...
I said I was going to blame you.


Eddie Corns

unread,
Dec 2, 2003, 7:10:49 AM12/2/03
to
"BJ MacNevin" <B...@replyhere.now> writes:

>Hi all,

>I teach middle school and am currently trying to bring some computer science
>to the students. Our district has a wonderfully linked network throughout
>all our schools... done via MS Windows Network. In order to protect the
>network, our district's IT department does not want things installed on the
>system (or at least makes it VERY difficult to get it done). SO, I am using
>MSW Logo installed onto a CD-ROM... we just stick in the CD-ROMS and run it
>off of them.

>BUT, I am learning about Python and think it is TERRIFIC! So I wonder if I
>can do the same thing... or something similar? Is there a way to install
>Python on a CD-ROM, too, if we don't need it to be accessed from a command
>prompt?

You *could* kill two birds with on CD by running a real OS (BSD or Linux) from
CD with Python built in. Just a point to consider, don't get too worked up
about it (it's a bit slow mind you).

Anyway, to answer the main question. You can create a file system with all the
Python files on it and run from there but I think the main problem is search
paths and the like. I believe you ideally need to get the relevant information
into the registry but if you're not able to I think this is problematic. So
I was wondering whether there was a howto on running Python from Windows
without it being in the registry (and for the OP how do you get it in the
registry without an install process). I have similar problems running from a
USB memory key but at least there I can write files to the same directory
where the binaries are (though it's not ideal).

Eddie

Michael Hudson

unread,
Dec 2, 2003, 7:25:45 AM12/2/03
to
ed...@holyrood.ed.ac.uk (Eddie Corns) writes:

> "BJ MacNevin" <B...@replyhere.now> writes:
>
> >Hi all,
>
> >I teach middle school and am currently trying to bring some computer science
> >to the students. Our district has a wonderfully linked network throughout
> >all our schools... done via MS Windows Network. In order to protect the
> >network, our district's IT department does not want things installed on the
> >system (or at least makes it VERY difficult to get it done). SO, I am using
> >MSW Logo installed onto a CD-ROM... we just stick in the CD-ROMS and run it
> >off of them.
>
> >BUT, I am learning about Python and think it is TERRIFIC! So I wonder if I
> >can do the same thing... or something similar? Is there a way to install
> >Python on a CD-ROM, too, if we don't need it to be accessed from a command
> >prompt?

Instinct says this Should Just Work. Things to worry about are
whether Python gets uppity about not being able to write to sys.path
(shouldn't do, happens all the time on linux) and making sure Python
can find its files.

[...]


> Anyway, to answer the main question. You can create a file system with all the
> Python files on it and run from there but I think the main problem is search
> paths and the like. I believe you ideally need to get the relevant information
> into the registry but if you're not able to I think this is problematic.

I am *fairly* sure that recent Pythons do not go near the registry.
win32all stuff does, and probably has to to get COM stuff working.

Cheers,
mwh

--
It is time-consuming to produce high-quality software. However,
that should not alone be a reason to give up the high standards
of Python development. -- Martin von Loewis, python-dev

Gerhard Häring

unread,
Dec 2, 2003, 7:58:58 AM12/2/03
to pytho...@python.org
Eddie Corns wrote:
> [...] I was wondering whether there was a howto on running Python from Windows
> without it being in the registry [...]

Here's the HOWTO, in one sentence:

Grab a Python directory, copy the python{major}{minor}.dll from
%SYSTEMROOT%\system32 into this Python directory.

In there, Python now runs standalone, and you can burn the whole
directory on a CD if you like.

win32 Python does have module search paths in the registry, but they
aren't required.

-- Gerhard


Fredrik Lundh

unread,
Dec 2, 2003, 8:06:44 AM12/2/03
to pytho...@python.org
Gerhard Häring wrote:
>
> Here's the HOWTO, in one sentence:
>
> Grab a Python directory, copy the python{major}{minor}.dll from
> %SYSTEMROOT%\system32 into this Python directory.

is the part after the comma really necessary?

(all installers I've ever used or created install the core DLL in the
Python directory as well. are there installers out there that don't
do that?)

</F>


Maxim Khesin

unread,
Dec 2, 2003, 9:38:48 AM12/2/03
to
how about using mxCGIPython (a single-file python binary)?

Arthur

unread,
Dec 2, 2003, 1:58:25 AM12/2/03
to BJ MacNevin, pytho...@python.org
> Hi all,
>
> I teach middle school and am currently trying to bring some computer
science
> to the students. Our district has a wonderfully linked network throughout
> all our schools... done via MS Windows Network. In order to protect the
> network, our district's IT department does not want things installed on
the
> system (or at least makes it VERY difficult to get it done). SO, I am
using
> MSW Logo installed onto a CD-ROM... we just stick in the CD-ROMS and run
it
> off of them.

I would take a look at Knoppix:

http://www.knoppix.net/

Its a bootable iso image of a Gnu/Linux operating system which has recent
Python distro included. Linux being a Very Good Thing for educational use,
IMO.

Perhaps even better for your purposes is

FREEDUC
Live CD-ROM of free software for schools

http://www.ofset.org/freeduc-cd/

Knoppix based, stocked with free educational software meant for the grade
levels you are concerned with.

What I don't know if either has IDLE readily accessible. Certainly Freeduc
should, if it doesn't.

Art


Gerhard Häring

unread,
Dec 2, 2003, 9:19:47 AM12/2/03
to pytho...@python.org

The Pythonlabs (or should it be called python-dev installer by now?) installer
doesn't do this. At least not in the Windows 2000 and XP installations I use.

-- Gerhard


Michael Hudson

unread,
Dec 2, 2003, 10:13:57 AM12/2/03
to
Gerhard Häring <g...@ghaering.de> writes:

ISTR this is helpful for win32all.

Cheers,
mwh

--
You're posting to a Scheme group. Around here, arguing that Java is
better than C++ is like arguing that grasshoppers taste better than
tree bark. -- Thant Tessman, comp.lang.scheme

Eddie Corns

unread,
Dec 2, 2003, 11:17:48 AM12/2/03
to
=?ISO-8859-1?Q?Gerhard_H=E4ring?= <g...@ghaering.de> writes:

OK ta, I will try this out. A chance to play with my new CD rewriter too.

Eddie


Gerhard Häring

unread,
Dec 2, 2003, 11:25:06 AM12/2/03
to pytho...@python.org
Fredrik Lundh wrote:
> Gerhard Häring wrote:
>> The Pythonlabs (or should it be called python-dev installer by now?)
>> installer doesn't do this (install pythonxy.dll in the Python dir.). At least

>> not in the Windows 2000 and XP installations I use.
>
> depends on the version, I suppose. the python.org installer I used on
> this machine sure left a python23.dll in the c:/python23 directory.

I suppose the difference is between admin- and non-admin install. I always make an
admin-install.

-- Gerhard


Tim Peters

unread,
Dec 2, 2003, 11:38:54 AM12/2/03
to Fredrik Lundh, pytho...@python.org
[/F]

>>> (all installers I've ever used or created install the core DLL in
>>> the Python directory as well. are there installers out there that
>>> don't do that?)

[someone, possibly Gerhard Häring]


>> The Pythonlabs (or should it be called python-dev installer by now?)

>> installer doesn't do this. At least not in the Windows 2000 and XP
>> installations I use.

[/F]


> depends on the version, I suppose. the python.org installer I used on
> this machine sure left a python23.dll in the c:/python23 directory.
>

> tim? thomas?

"Early" PLabs installers stuffed python23.dll into the system directory, and
scribbled registry entries under HKLM. They may also try to update a couple
MSVC runtime DLLs in the system directory (e.g., Win95 didn't come with
msvcrt.dll out of the box, and Python needs it).

"Later" PLabs installers (sometime shortly after I started building them)
grew a choice, controlled by a radio button for doing an Admin or non-Admin
install. The Admin install is the default if the user running the installer
has admin privileges, and acts like early PLabs installers. The non-Admin
install is the default if the user running the installer does not have admin
privileges, writes nothing to a system directory, scribbles registry entries
under HKCU, and installs python23.dll and a couple MSVC runtime DLLs into
the root Python directory.

I don't think Thomas has changed any of that (yet <wink>).


Fredrik Lundh

unread,
Dec 2, 2003, 11:16:27 AM12/2/03
to pytho...@python.org
Gerhard Häring wrote:

> >>Grab a Python directory, copy the python{major}{minor}.dll from
> >>%SYSTEMROOT%\system32 into this Python directory.
> >

> > is the part after the comma really necessary?
> >

> > (all installers I've ever used or created install the core DLL in the
> > Python directory as well. are there installers out there that don't
> > do that?)
>

> The Pythonlabs (or should it be called python-dev installer by now?) installer
> doesn't do this. At least not in the Windows 2000 and XP installations I use.

depends on the version, I suppose. the python.org installer I used on


this machine sure left a python23.dll in the c:/python23 directory.

tim? thomas?

</F>


Thomas Heller

unread,
Dec 2, 2003, 1:26:15 PM12/2/03
to
"Fredrik Lundh" <fre...@pythonware.com> writes:

As Tim said, this hasn't changed yet - for admin installs it goes into
the system directory.

For 2.3 releases it will stay this way, for future releases I
don't know.

win32all is growing in a direction where it makes fewer use of the
registry than in the past, and the sandbox py2exe is already able to
create frozen com servers which work fine with python23.dll in the
executable directory, so I assume somewhere in the future Python
releases don't need dlls in the system directory anymore.

Thomas

Peter Hansen

unread,
Dec 2, 2003, 9:32:24 PM12/2/03
to
Thomas Heller wrote:
>
> win32all is growing in a direction where it makes fewer use of the
> registry than in the past, and the sandbox py2exe is already able to
> create frozen com servers which work fine with python23.dll in the
> executable directory, so I assume somewhere in the future Python
> releases don't need dlls in the system directory anymore.

Technically, no release since at least 2.0 has required DLLs in
the system directory, but it has taken some work (growing less by
the release) to make that possible. We've used a shared network
installation of Python for each release from 2.0 on, with only
minor tweaking.

Initially we had to move the DLLs manually from the installation
machine's SYSTEM directory to the network drive. Now the non-admin
option resolves that issue.

win32all is for us the only remaining issue. We need to include
a .pth file with two or three paths in it (even though the package
installs itself under site-packages now!). We also still need to
set up a sitecustomize.py file which does imports on pythoncom and
pywintypes, or an import of win32api (for example) will fail.
I don't recall the explanation, but without first importing those
(or perhaps just one?) modules you can't import the win32 stuff,
but if they have been imported first, then it works fine.

Details/help supplied to those with troubles doing this, on request...

-Peter

Thomas Heller

unread,
Dec 3, 2003, 5:22:22 AM12/3/03
to
Peter Hansen <pe...@engcorp.com> writes:

> Thomas Heller wrote:
>>
>> win32all is growing in a direction where it makes fewer use of the
>> registry than in the past, and the sandbox py2exe is already able to
>> create frozen com servers which work fine with python23.dll in the
>> executable directory, so I assume somewhere in the future Python
>> releases don't need dlls in the system directory anymore.
>
> Technically, no release since at least 2.0 has required DLLs in
> the system directory, but it has taken some work (growing less by
> the release) to make that possible. We've used a shared network
> installation of Python for each release from 2.0 on, with only
> minor tweaking.
>
> Initially we had to move the DLLs manually from the installation
> machine's SYSTEM directory to the network drive. Now the non-admin
> option resolves that issue.
>
> win32all is for us the only remaining issue. We need to include
> a .pth file with two or three paths in it (even though the package
> installs itself under site-packages now!). We also still need to
> set up a sitecustomize.py file which does imports on pythoncom and
> pywintypes, or an import of win32api (for example) will fail.

Hehe, you know that you can import modules in the .pth file itself,
don't you? 'import ...' lines are executed.

> I don't recall the explanation, but without first importing those
> (or perhaps just one?) modules you can't import the win32 stuff,
> but if they have been imported first, then it works fine.

Because win32api.pyd links against pywintypes23.dll, but the latter is
not on the DLL load path. So it must be imported first by
pywintypes.py, which then replaces it's module dict by pywintypes23's
dict. Or something like that.

Thomas

cmkl

unread,
Dec 3, 2003, 6:28:25 AM12/3/03
to
I've done this with Python-2.3.2-1 on Windows
with installing a 'registry free' Python on
local network. It should work with a CD-ROM
copy as well.

First step is to install Python on a machine
locally as a non-administrator. You could
change this as an option in the Python installer.
The non-admin option ensures, that all needed
DLLs are packed in the Python directory rather the
Windows system directory.
Next step are win32all, wxPython, GTK, pyGTK
and all other needed packages.

This version uses the registry, but the registry
wouldn't be readed if you set the enviroment
variables %PYTHONHOME% and %PYTHONPATH%.

If you want to use pyGTK you have to change the
PATH variable too. For some systems with old versions
of some MS DLLs you may want to ensure that the
DLLs delivered with the Python packages are loaded
at runtime. I use a variable called "PY_DEPRECATED_OS".
All MS DLLs have to be moved in a dedicated directory,
i.e. %PYTHONHOME%DLLs\MS_DLLs . (see example below)

All this enviroment tweaking could be done by startup
batch files instead of changing the enviroment on every
Windows client (except the PY_DEPRECATED_OS variable)
See the Pythonwin.bat file below. You can create startup
files for python, pythonw, idle as needed.

----- Pythonwin.bat example -------------------------------------
@echo off
setlocal

if not "x%PYTHONHOME%" == "x" goto _START
rem never overwrite PYTHONHOME, PYTHONPATH und PATH
rem if PYTHONHOME was still set in enviroment

if not "x%OS%" == "xWindows_NT" goto _WINDOWS9X
rem Windows NT and Win9x differs
set PYTHONHOME=%~dp0
goto _PYTHONPATH

:_WINDOWS9X
set PYTHONHOME=%0\..\
goto _PYTHONPATH

:_PYTHONPATH
rem PYTHONPATH for win32all
set PYTHONPATH=%PYTHONHOME%lib\site-packages\Pythonwin;%PYTHONHOME%lib\site-packages\win32;%PYTHONHOME%lib\site-packages\win32\lib

rem PATH for GTK-2.0
set PATH=%PYTHONHOME%..\GTK\2.0\bin;%PYTHONHOME%..\GTK\2.0\lib;%PATH%

rem PATH for MS DLLs
if "x%PY_DEPRECATED_OS%" == "xTRUE" set
PATH=%PYTHONHOME%DLLs\MS_DLLs;%PATH%

:_START
start %PYTHONHOME%pythonwin.exe %*
endlocal
----- Pythonwin.bat example end ---------------------------------


"BJ MacNevin" <B...@replyhere.now> wrote in message news:<BhVyb.389117$Tr4.1144562@attbi_s03>...

Peter Hansen

unread,
Dec 3, 2003, 8:01:58 AM12/3/03
to
Thomas Heller wrote:
>
> Hehe, you know that you can import modules in the .pth file itself,
> don't you? 'import ...' lines are executed.

Nope! Even better... thanks, Thomas! :-)

-Peter

BJ MacNevin

unread,
Dec 3, 2003, 8:57:23 AM12/3/03
to
Cool idea, Arthur!

I tried to download KNOPPIX last night, and to no avial. The knoppix servers
are currently restricted from allowing downloadings. DOH! I tried to find an
available mirror someplace, but had no luck.

BJ MacNevin

"Arthur" <a...@optonline.net> wrote in message
news:mailman.47.10703758...@python.org...

BJ MacNevin

unread,
Dec 3, 2003, 8:59:38 AM12/3/03
to
WOW!
Lots of responses. Thanks everyone! I need to play around with it more. My
first attempt of just dragging the C:\python23 directory and copying the
.dll's into it did work by and large... no IDLE which is a bummer (but
understandable). So I will try some of the other options shared here.

Thanks again for all the great and helpful feedback!

BJ MacNevin

"BJ MacNevin" <B...@replyhere.now> wrote in message
news:BhVyb.389117$Tr4.1144562@attbi_s03...

Cousin Stanley

unread,
Dec 3, 2003, 9:56:49 AM12/3/03
to
| I tried to download KNOPPIX last night, and to no avial.
| The knoppix servers are currently restricted from allowing downloadings.
| DOH! I tried to find an available mirror someplace, but had no luck.

BJ ....

Knoppix 3.3 is available on CD from CheapBytes.Com
for $5 US ....

http://www.cheapbytes.com

I was lucky enough to download an earlier version,
and although I have a fairly fast connection,
I will order the next one pre-burned on CD ....

--
Cousin Stanley
Human Being
Phoenix, Arizona

Eddie Corns

unread,
Dec 3, 2003, 10:40:26 AM12/3/03
to
"BJ MacNevin" <B...@replyhere.now> writes:

>Cool idea, Arthur!

>I tried to download KNOPPIX last night, and to no avial. The knoppix servers
>are currently restricted from allowing downloadings. DOH! I tried to find an
>available mirror someplace, but had no luck.

If you are interested in going this route (and you ought to be) it might be
worth checking out Morphix (http://morphix.sourceforge.net/) which allows you
to create your own Knoppix distributions. Basically adding your own
requirements to the base distribution (or removing things you don't want your
students to have).

Eddie

0 new messages