Install libraries only without the program itself

6 views
Skip to first unread message

Gregor Horvath

unread,
May 11, 2006, 7:11:59 AM5/11/06
to
Hi,

My application is a client/server in a LAN. I want to keep my programs
.py files on a central File Server serving all clients. The clients
should load those over the LAN every time they start the program since I
expect that they are rapidly changing and I dont want to update each
client seperatly.

On the clients there should only be python and the necessary libraries
and third party modules (sqlobject etc.) installed.

How do I make a setup script that only installs the necessary things,
without the program itself. Is there a tool for that?

--
Servus, Gregor
http://www.gregor-horvath.com

Serge Orlov

unread,
May 11, 2006, 9:39:44 AM5/11/06
to
Gregor Horvath wrote:
> Hi,
>
> My application is a client/server in a LAN. I want to keep my programs
> .py files on a central File Server serving all clients. The clients
> should load those over the LAN every time they start the program since I
> expect that they are rapidly changing and I dont want to update each
> client seperatly.

Don't forget you can screw up running clients if you override old
version with a new one.

> On the clients there should only be python and the necessary libraries
> and third party modules (sqlobject etc.) installed.

I believe it's better to keep *everything* on the file server. Suppose
your OS is windows and suppose you want to keep everything in s:/tools.
The actions are:
1. Copy python with all 3rd party modules from c:/python24 to
s:/tools/python24-win32
2. Grab exemaker from http://effbot.org/zone/exemaker.htm, copy
exemaker.exe to s:/tools/win32/client.exe
3. Create little dispatcher s:/tools/win32/client.py:
#!s:/tools/python24-win32/python.exe
import sys
sys.path[0] = "s:/tools/client-1.0.0"
import client
4. Create your first version of s:/tools/client-1.0.0/client.py:
print "I'm a client version 1.0.0"
-----------------------------
That's it. Now s:/tools/win32/client.exe is ready to go. I guess it's
obvious how to release version 1.0.1 If you need to support other
architectures or operating systems you just need to create tiny
dispatchers in directories s:/tools/linux, s:/tools/macosx ...

Gregor Horvath

unread,
May 11, 2006, 1:08:45 PM5/11/06
to
Serge Orlov schrieb:

> I believe it's better to keep *everything* on the file server. Suppose

Certainly!

> your OS is windows and suppose you want to keep everything in s:/tools.
> The actions are:

> 3. Create little dispatcher s:/tools/win32/client.py:
> #!s:/tools/python24-win32/python.exe
> import sys
> sys.path[0] = "s:/tools/client-1.0.0"
> import client

I also had to set the paths for the imports and current directory
manually (why?). This worked for me:

#!y:/python24-win32/python24.dll
import sys
import os
sys.path =
["","y:\\","y:\\python24-win32\\lib\\site-packages","y:\\python24-win32\\DLLs","y:\\python24-win32\\lib","y:\\python24-win32\\lib\\plat-win","y:\\python24-win32\\lib\\lib-tk","y:\\python24-win32",
"y:\\python24-win32\\lib\\site-packages\\win32",
"y:\\python24-win32\\lib\\site-packages\\win32\\lib",
"y:\\python24-win32\\lib\\site-packages\\Pythonwin",
"Y:\\python24-win32\\python24.zip","y:\\python24-win32"]
os.chdir("y:\\")

import hobel300


5. I also had to copy all required dlls from the c:\winnt directory (for
example pywintypes24.dll) into the current directory.

Thanks for this solution, works great, did not know that you can run
python programs even without a python installation on the local machine!
Nice!

Reply all
Reply to author
Forward
0 new messages