Re: [Zope] How to split a string in a python method?

2001-01-05 Thread Jim Washington

Yes. Just use it. string is already in the Python Methods namespace.

EXAMPLE:

Python Method 

Parameter list: self

Python function body:

testsentence = 'I want this sentence to be converted into a list of its
component words.'
thelist = string.split(testsentence)
for aword in thelist:
  print aword
return printed

-- Jim Washington

Juan Carlos Coruña wrote:
> 
> Is there any way to split a string in a PythonMethod without passing the
> object _.string as an argument?
> 
> I have tried to "import string" but Zope generates an ImportError:
> 
> ImportError: __import__ not found
> 
> I'm using PythonMethod 0.1.7

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] How to split a string in a python method?

2001-01-05 Thread Juan Carlos Coruña

Is there any way to split a string in a PythonMethod without passing the
object _.string as an argument?

I have tried to "import string" but Zope generates an ImportError:

ImportError: __import__ not found

I'm using PythonMethod 0.1.7


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )