Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > importing re in Jython

Reply
Thread Tools

importing re in Jython

 
 
Alexis Francart
Guest
Posts: n/a
 
      07-09-2003
Hello,

I want to use a program called maxq. This program is used for functionnal
and regression test of web application. The language it uses is Jython.
I need to get a part of a web page using regular expression.
However i try to import the RE library but i'm not able to.
Since the Jython.jar already contains an ORO i tried to use it but without
success. I then tried to import the RE library but was unable to do so. I
then try to import the regexp library from jakarta but without success.

Do you know how i can import the RE module in Jython?

NB: I hope the part on my life interested you since it has not too much to
do with the question.

Alexis
 
Reply With Quote
 
 
 
 
Alexis Francart
Guest
Posts: n/a
 
      07-09-2003
Alexis Francart <> wrote in
news:Xns93B386C32C053alexisfrancartnospam@193.252. 19.141:

> Do you know how i can import the RE module in Jython?


Ok i've managed to import it. I'm new to jython and python so i think this
is basic but unless the command line you have got to enter the whole pass
in the script so ihave to enter

from org.python.modules import re

instead of a simple

import re

thanks for your help
 
Reply With Quote
 
 
 
 
Alan Kennedy
Guest
Posts: n/a
 
      07-09-2003
Alexis Francart wrote:

> Do you know how i can import the RE module in Jython?


Works fine for me on Win2K, J2SDK1.4.2 and Jython 2.1:-

Jython 2.1 on java1.4.2 (JIT: null)
Type "copyright", "credits" or "license" for more information.
>>> import re
>>> rx = re.compile('[0-9]+')
>>> for sn in ['1', '10', 's10']:

.... m = rx.match(sn)
.... if m:
.... print "'%s' matches" % sn
....
'1' matches
'10' matches
>>>


Perhaps if you gave us some details, such as

1. Your OS
2. Your JRE version
3. Your jython version
4. What code you're using

Then it might be easier to help out.

--
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan: http://xhaus.com/mailto/alan
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Jython: Packing several .py on .jar, problem importing .py moduleswithin the .jar Gubatron Python 2 12-03-2008 06:01 PM
FW: [Jython-users] Jython Licensing Question Pinegar, Kent T Python 0 07-24-2008 01:38 PM
FW: [Jython-users] ERROR : parsing xml in jython Divya Prakash Python 0 12-19-2006 02:49 PM
jython problem importing a py file didier.prophete@gmail.com Python 2 02-07-2006 05:37 PM
[Jython-users] ANN: SPIRO - a cPython->Jython bridge (amongst otheruses) David McNab Python 0 04-09-2004 10:20 AM



Advertisments