<br><br><div class="gmail_quote">On Tue, May 13, 2008 at 11:16 PM, <<a href="mailto:castironpi@gmail.com">castironpi@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On May 13, 6:06 am, "Gabriel Genellina" <<a href="mailto:gagsl-...@yahoo.com.ar">gagsl-...@yahoo.com.ar</a>><br>
wrote:<br>
> En Tue, 13 May 2008 07:30:44 -0300, Mike <<a href="mailto:42fli...@gmail.com">42fli...@gmail.com</a>> escribió:<br>
<div class="Ih2E3d">><br>
><br>
><br>
><br>
><br>
> > I'm trying to use the feedparser module (<a href="http://www.feedparser.org/" target="_blank">http://www.feedparser.org/</a>).<br>
><br>
> > Is it possible to use this without running the setup program?<br>
><br>
> > I don't see why not, seems like I'm missing something obvious.<br>
><br>
> > My directory structure is:<br>
><br>
> > myprogram.py<br>
> > /feedparser<br>
> > /feedparser.py<br>
><br>
> > I know I can install the module in the modules directory but would like <br>
> > to<br>
> > avoid this for two reasons: I'm only using it for the one project so <br>
> > would<br>
> > like to keep it seperate, and if I move to a shared host I may not be<br>
> > allowed to install additional modules (not sure if this is correct <br>
> > though).<br>
><br>
</div><div class="Ih2E3d">> The easiest way would be to put the single module feedparser.py in the <br>
> same directory as your program (I don't completely get your reasons not <br>
> to do that). OR put feedparser.py in some other directory that is already <br>
> listed in sys.path. OR add the directory containing feedparser.py to <br>
> sys.path, just at the beginning of your program.<br>
><br>
</div><div class="Ih2E3d">> > I've tried:<br>
><br>
> > import feedparser<br>
><br>
> > import feedparser.feedparser<br>
><br>
> > from feedparser import feedparser<br>
><br>
> > What am I doing wrong? :)<br>
><br>
</div><div class="Ih2E3d">> *IF* the directory 'feedparser' were a package (that is, if it contained a <br>
> file __init__.py), then that last import statement would be valid. But I <br>
> don't reccomend doing this; you're changing the module's environment.<br>
><br>
> --<br>
</div>> Gabriel Genellina- Hide quoted text -<br>
><br>
> - Show quoted text -<br>
<br><br></blockquote></div>I've overlooked the fact there is no _init_.py, I was expecting it to behave as a package. I'll put the file in my current directory as you suggested. Thanks for the explanation, it was very helpful and much appreciated.<br>