(no subject)

Emile van Sebille emile at fenx.com
Mon Feb 14 08:01:39 EST 2000


Pedro,

Assuming you've just got a problem with this function in
your class, it looks like you need to use the '%' appropriately:

     def subobj_fs(self,obj):
         import os
         lst = os.listdir("/var/spool/news/articles/%s" % obj)
         return lst

HTH,

Emile van Sebille
emile at fenx.com
-------------------


----- Original Message ----- 
From: Pedro Silva <psilva at ruido-visual.pt>
To: Python - Questions <python-list at python.org>
Sent: Monday, February 14, 2000 4:05 AM
Subject: (no subject)


> Hi,
> 
> I have some External Method with this code:
> 
>     def subobj_fs(self,obj):
>         import os,os.path
>         lst = os.listdir("/var/spool/news/articles/obj") %(obj)
>         x = len(lst)
>         return lst
> 
> In my dtml Method, Zope, I call this function like this:
> 
> 
>    <dtml-var subobj_fs(products)>
> 
> Then this would call the function in the External Method and list the
> directories in var/spool/news/articles/products.
> 
> Is this like this?
> 
> I already tryed to execute this and it gave me and error, Key error.
> I've saw it already, but I can't figure where is the error.
> 
> Can anyone help me?
> 
> Please, send your answers to: psilva at ruido-visual.pt
> 
> Thanks,
> 
> Pedro Silva
> 
> 
> -- 
> http://www.python.org/mailman/listinfo/python-list
> 






More information about the Python-list mailing list