By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,461 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Can Python be run off of a CD-ROM?

P: n/a
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.
Jul 18 '05 #1
Share this Question
Share on Google+
20 Replies


P: n/a
"BJ MacNevin" <BJ@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
Jul 18 '05 #2

P: n/a
ed***@holyrood.ed.ac.uk (Eddie Corns) writes:
"BJ MacNevin" <BJ@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
Jul 18 '05 #3

P: n/a
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
Jul 18 '05 #4

P: n/a
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>


Jul 18 '05 #5

P: n/a
how about using mxCGIPython (a single-file python binary)?
BJ MacNevin wrote:
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


Jul 18 '05 #6

P: n/a
Fredrik Lundh wrote:
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?)


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
Jul 18 '05 #7

P: n/a
> 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
Jul 18 '05 #8

P: n/a
Gerhard Häring <gh@ghaering.de> writes:
Fredrik Lundh wrote:
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?)


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.


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
Jul 18 '05 #9

P: n/a
=?ISO-8859-1?Q?Gerhard_H=E4ring?= <gh@ghaering.de> writes:
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.


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

Eddie
Jul 18 '05 #10

P: n/a
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
Jul 18 '05 #11

P: n/a
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>


Jul 18 '05 #12

P: n/a
"Fredrik Lundh" <fr*****@pythonware.com> writes:
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?


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
Jul 18 '05 #13

P: n/a
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
Jul 18 '05 #14

P: n/a
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
Jul 18 '05 #15

P: n/a
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" <BJ@replyhere.now> wrote in message news:<BhVyb.389117$Tr4.1144562@attbi_s03>...
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

Jul 18 '05 #16

P: n/a
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
Jul 18 '05 #17

P: n/a
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" <aj*@optonline.net> wrote in message
news:ma*************************************@pytho n.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

Jul 18 '05 #18

P: n/a
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" <BJ@replyhere.now> wrote in message
news:BhVyb.389117$Tr4.1144562@attbi_s03...
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.

Jul 18 '05 #19

P: n/a
| 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

Jul 18 '05 #20

P: n/a
"BJ MacNevin" <BJ@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
Jul 18 '05 #21

This discussion thread is closed

Replies have been disabled for this discussion.