Re: [Zope] importing string module in python METHOD - a problem that shouldn't be aproblemproblem

2001-01-13 Thread Evan Simpson

From: "Lee" <[EMAIL PROTECTED]>
> I have a Python method that needs to use the string module. In the
> method body I have the 'import string' statement but when I try it =>

As Shane mentioned, 'import' is only enabled in Python Scripts, but Python
Methods pre-import all of the same modules as DTML, including 'string'.

Cheers,

Evan @ digicool & 4-am


___
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 )




Re: [Zope] importing string module in python METHOD - a problem that shouldn't be aproblemproblem

2001-01-13 Thread Shane Hathaway

Lee wrote:
> I have a Python method that needs to use the string module. In the
> method body I have the 'import string' statement but when I try it =>
> 
> Error Type: ImportError
> Error Value: __import__ not found

import is available in Python Scripts but not Python Methods.  PS is
available in Zope 2.3.x.

Shane

___
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] importing string module in python METHOD - a problem that shouldn't be aproblemproblem

2001-01-13 Thread Lee

Hi,

I have a Python method that needs to use the string module. In the
method body I have the 'import string' statement but when I try it =>

Error Type: ImportError
Error Value: __import__ not found

The documentation collaborates that import statements (the string module
specifically) can be used in Python methods. The method body is...

import string
text = details
y = string.split(text,"x")
studentMatric = y[0]
studentRecord = y[1]
return studentMatric + studentRecord

.., which results in the above error. Can anyone suggest a reason for
this? I think (hope) it'll work if I put it in my extensions directory.

Thanks very much,

Lee

--
Lee Reilly
mailto:[EMAIL PROTECTED]

ø¤º°`°º¤øø¤º°`°º¤øø¤º°`°º¤øø¤º°`°º¤ø

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/




___
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 )