<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Python Package Distribution</title>
	<atom:link href="http://www.softimageblog.com/archives/18/feed" rel="self" type="application/rss+xml" />
	<link>http://www.softimageblog.com/archives/18#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=python-package-distribution</link>
	<description>People and thoughts behind Softimage in production...</description>
	<lastBuildDate>Fri, 23 Jul 2010 12:23:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Patrick Boucher</title>
		<link>http://www.softimageblog.com/archives/18/comment-page-1#comment-38</link>
		<dc:creator>Patrick Boucher</dc:creator>
		<pubDate>Tue, 05 Apr 2005 23:08:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.xsi-blog.com/?p=18#comment-38</guid>
		<description>I agree that the .pth files are a great way to alter the Python search path, but as someone who is distributing your script to a wide audience, you don&#039;&#039;t have control over your user&#039;&#039;s .pth files.

The idea was to find a way to give a script that relies heavilly on external custom libraries to a non technical user. A user who might not have the expertise (or rights for that matter) to alter his Python path. If that user can&#039;&#039;t add .pth files or alter an environment variable due to rights restrictions can we still give him tools that are built on a library with little to no configuration work on his behalf?

I agree that the way I described above if far from optimal but I haven&#039;&#039;t had time to dig any deeper.</description>
		<content:encoded><![CDATA[<p>I agree that the .pth files are a great way to alter the Python search path, but as someone who is distributing your script to a wide audience, you don&#8221;t have control over your user&#8217;&#8217;s .pth files.</p>
<p>The idea was to find a way to give a script that relies heavilly on external custom libraries to a non technical user. A user who might not have the expertise (or rights for that matter) to alter his Python path. If that user can&#8221;t add .pth files or alter an environment variable due to rights restrictions can we still give him tools that are built on a library with little to no configuration work on his behalf?</p>
<p>I agree that the way I described above if far from optimal but I haven&#8221;t had time to dig any deeper.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernard Lebel</title>
		<link>http://www.softimageblog.com/archives/18/comment-page-1#comment-36</link>
		<dc:creator>Bernard Lebel</dc:creator>
		<pubDate>Tue, 05 Apr 2005 20:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.xsi-blog.com/?p=18#comment-36</guid>
		<description>The .pth file approach is, imho, BY FAR the easiest way to deal with the PYTHONPATH issue. Just drop a text file with a .pth extension into the Python root directory (ie: C:\Python24) that contains the path to the module of your choice, and there you go, you can import directly the scripts in that directory without naming any directory.

After that, the only thing you need to traverse down subdirectories is to separate directory names with a dot in your import statement:

import subdirectory1.subdirectory2.myModuleFile

Wich is the same as, on Windows:

import \subdirectory1\subdirectory2\myModuleFile.py




I do have a question though, regarding the __init__.py files. Has anyone here manage to assign subdirectory globals through init files? If I try to create an XSIApplication object or assign a name to the XSI constants in the init file, the modules of this directory do not get them.... so I have to assign them in every module.


Cheers
Bernard</description>
		<content:encoded><![CDATA[<p>The .pth file approach is, imho, BY FAR the easiest way to deal with the PYTHONPATH issue. Just drop a text file with a .pth extension into the Python root directory (ie: C:\Python24) that contains the path to the module of your choice, and there you go, you can import directly the scripts in that directory without naming any directory.</p>
<p>After that, the only thing you need to traverse down subdirectories is to separate directory names with a dot in your import statement:</p>
<p>import subdirectory1.subdirectory2.myModuleFile</p>
<p>Wich is the same as, on Windows:</p>
<p>import \subdirectory1\subdirectory2\myModuleFile.py</p>
<p>I do have a question though, regarding the __init__.py files. Has anyone here manage to assign subdirectory globals through init files? If I try to create an XSIApplication object or assign a name to the XSI constants in the init file, the modules of this directory do not get them&#8230;. so I have to assign them in every module.</p>
<p>Cheers<br />
Bernard</p>
]]></content:encoded>
	</item>
</channel>
</rss>
