[Zope] problem with zfill

David Hassalevris bluepaul@earthlink.net
Sat, 7 Jun 2003 15:28:59 -0700


Adam,
try
import string
return string.zfill(outa,6)
David
----- Original Message ----- 
From: "Adam Szpakowski" <worf@optics.polsl.gliwice.pl>
To: <zope@zope.org>
Sent: Saturday, June 07, 2003 2:31 PM
Subject: [Zope] problem with zfill


> Hi,
> 
> I've strange problem with using zfill in python scripts in Zope.
> 
> My script is simple:
> --------------
> import string
> outa = str1.zfill(6)
> return outa
> --------------
> 
> str1 is a parameter given by interface. 
> 
> Running the script gives me:
> 
> Error Type: AttributeError
> Error Value: 'str' object has no attribute 'zfill'
> 
> I understand the meaning of the error but why it's happening?
> 
> Others functions like:
> outa = str1.upper()
> works great. 
> 
> Zope is in version 2.6.1 and Python in 2.2.1.
> 
> Regards,
> 
> -- 
> Adam Szpakowski
> Silesian University of Technology - Institute of Physics
> Department of Optoelectronic
> e-mail: worf@optics.polsl.gliwice.pl
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )