[python-win32] IMPORT path

Metz, Bobby W, WWCS bwmetz at att.com
Tue Sep 12 05:06:39 CEST 2006


For argument's sake, let's say your new code is saved as HelloWorld.py in a directory named modules, which is a sub-directory under your main project files directory.  Some may disagree, but using a single directory like this for all your custom modules is a good method.
 
import sys
sys.path.append("./modules")
import HelloWorld
 
Bobby

-----Original Message-----
From: python-win32-bounces at python.org [mailto:python-win32-bounces at python.org]On Behalf Of Christian Menge
Sent: Monday, September 11, 2006 7:49 PM
To: python-win32 at python.org
Subject: [python-win32] IMPORT path


Guys,

I have a simple script that will create a window and print "Hello World". What I want to do is import this script into another script which control may program. The problem I'm having is with the Import path. When I move my "Hello World" script away from the development directories the path gets lost and Python can not find the modules. 

As a C++ developer I would simply compile my project statically....which includes all of the libraries in one place/package. How do I do this with Python?

Christian


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20060911/cab99eb3/attachment.htm 


More information about the Python-win32 mailing list