470,821 Members | 2,087 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,821 developers. It's quick & easy.

Bigger projects, including files?

if i have a larger project and want to divide my program into several
files, how do i include these files in the mainprogram?

using import someprojectfile doesnt work because import is for site-
packages right and i dont want to put all my files
in that folder.

so how do i do it?

Jun 27 '08 #1
2 752
globalrev wrote:
if i have a larger project and want to divide my program into several
files, how do i include these files in the mainprogram?

using import someprojectfile doesnt work because import is for site-
packages right and i dont want to put all my files
in that folder.

so how do i do it?
You can always add the path where the other files are to sys.path
I've posted a while ago something that sort of does that for
inter-package reference if the root is not in the sys.path
http://groups.google.com/group/comp....29ab20b4d4bc97
hth
--
mph
Jun 27 '08 #2
On 20 Apr, 02:04, "Martin P. Hellwig" <x...@xs4all.nlwrote:
globalrev wrote:
if i have a larger project and want to divide my program into several
files, how do i include these files in the mainprogram?
using import someprojectfile doesnt work because import is for site-
packages right and i dont want to put all my files
in that folder.
so how do i do it?

You can always add the path where the other files are to sys.path
I've posted a while ago something that sort of does that for
inter-package reference if the root is not in the sys.pathhttp://groups.google.com/group/comp.lang.python/browse_thread/thread/...
hth
--
mph
thanks. i saw now myself that import works if it is in the same folder
as well.
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Adriaan Renting | last post: by
1 post views Thread by Wilson Ricardo Passos Oliveira | last post: by
4 posts views Thread by Mikkel christensen | last post: by
14 posts views Thread by Jason Heyes | last post: by
6 posts views Thread by Gaijinco | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.