<div dir="ltr">You need to have a __init__.py file for python to look at the directory as a module. So basically:<br><br>/home/me/pythondir/__init__.py<br>/home/me/pythondir/file1.py<br>/home/me/pythondir/file2.py<br>...<br>
PYTHONPATH=$PYTHONPATH:/home/me/pythondir<br><br>then you can<br>python -c &quot;import file1&quot;<br><br>__init__.py can contain nothing, easiest way to create it is with touch:<br><br>touch /home/me/pythondir/__init__.py<br>
<br>But yes, you should just look at the python docs - try:<br><a href="http://docs.python.org/tut/node8.html#SECTION008400000000000000000">http://docs.python.org/tut/node8.html#SECTION008400000000000000000</a><br><br>Alon<br>
<br><div class="gmail_quote">On Fri, Aug 15, 2008 at 10:29 PM, C R McClenaghan <span dir="ltr">&lt;<a href="mailto:chris@mcclenaghan.com">chris@mcclenaghan.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I thought I&#39;d try some different things and learn python along the way.<br>
<br>
I have FSO MS 2 installed with opkg feeds updated and including the<br>
angstrom repository feed.<br>
<br>
I don&#39;t seem to be able to install python packages which appear in the<br>
angstrom repository, although I have installed other non-python<br>
packages from angtrom - e.g., libnotify, etc., for the the alpha 2<br>
version of gestures working. Perhaps there is something about opkg I<br>
don&#39;t understand. I added a base-feeds.conf &nbsp;per the instructions here <a href="http://wiki.openmoko.org/wiki/Repositories" target="_blank">http://wiki.openmoko.org/wiki/Repositories</a><br>
.<br>
<br>
With respect to python, I&#39;m assuming that I can install any python<br>
package/file I choose and it need not come through the opkg system,<br>
just drop the *.py file(s) where it can be found. Now that leads to<br>
what is probably simply a python question, but I&#39;ll ask it anyway,<br>
what is the proper way to set PYTHONPATH such that a new directory of<br>
python files will be found? I tried:<br>
<br>
PYTHONPATH=$PWD<br>
<br>
where the files were in my current directory and the import statements<br>
still failed.<br>
<br>
Thanks,<br>
<br>
Chris<br>
<br>
_______________________________________________<br>
support mailing list<br>
<a href="mailto:support@lists.openmoko.org">support@lists.openmoko.org</a><br>
<a href="https://lists.openmoko.org/mailman/listinfo/support" target="_blank">https://lists.openmoko.org/mailman/listinfo/support</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Alon Levy<br><a href="http://wiki.saymoo.org/">http://wiki.saymoo.org/</a><br>
</div>