Intra-package References?? (again)

2008-01-29 Thread marcroy . olsen
Hi Python list,

I have been struggleling with this before, but have never been able to
find a good solution.
The thing I dont understand is, I follow the guide here:
http://docs.python.org/tut/node8.html#SECTION00842
And have the same setup as the packages howto here:http://
docs.python.org/tut/node8.html#SECTION00840

But when I want to use Intra-package References, I need to put the
path to the packages explicit like this:
#sys.path.append('/path/to/pack/')
Before I can make import like this:
#from Sound.Effects import echo
from within the karaoke.py (just to stay with the tut)
If I print the sys.path from the same file, I can see that
#/path/to/pack/Sound/Filters/
is in the path.

Is there something that I completely is missing or could someone
please show me how, by example, how I use Intra-package References.

Best regards

Marc
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lxml on mac

2008-01-24 Thread marcroy . olsen
On Jan 23, 5:08 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote:

>
> > But do anybody know if there is an easy way to use schema validation
> > in python(on a mac) ?
>
> You mean: easier than the above? Likely not many...
>


Well thanks for the reply's.

I found GenerateDS make by Dave Kuhlman. I will try to give that a go.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Lxml on mac

2008-01-23 Thread marcroy . olsen
On Jan 23, 4:19 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > What to one do if one what to use lxml(http://codespeak.net/lxml/
> > index.html) on a mac?
>
> Have you tried installing up-to-date versions of libxml2/libxslt and running
>
>    easy_install lxml
>
> ?
>
> Stefan

No not yet. That was my nest step.

But do anybody know if there is an easy way to use schema validation
in python(on a mac) ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Lxml on mac

2008-01-23 Thread marcroy . olsen
Hi,

What to one do if one what to use lxml(http://codespeak.net/lxml/
index.html) on a mac?

Best regards
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What is the best way to do dynamic imports ?

2007-12-30 Thread marcroy . olsen
First of thanks to all for you, especially for the quick replys.

Just need to walk the dog then I giv it a short.


On Dec 30, 3:57 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
wrote:
>
> > Do anybody now a good howto or tutorial to this?
>
> No... what do you want covered?

Nothing, think you reply coved it all.

Otherwise I will be back ;-)

-- 
http://mail.python.org/mailman/listinfo/python-list


What is the best way to do dynamic imports ?

2007-12-30 Thread marcroy . olsen
Hi list and python gurus :-)

I'm playing with some mod_python and web development. And in me code I
need to do som dynamic imports.
Right now I just do a:

exec 'import '+some_modulename

But it seems to easy, is there a "dark side" to doing it this way?
(memory use,processing ,etc)
And have to I check if the modul is already loaded?


Another thing is how to call my dynamic imported moduls.
Now I use exec (as with my modules), like this:

exec 'newclass = '+classname+'()'
newclass.somefunction()

Again it seems to easy. Is there a better/proper way to do it?


Do anybody now a good howto or tutorial to this?


Many thanks and hope you all have a happy new year :-)

/marc
-- 
http://mail.python.org/mailman/listinfo/python-list