Previous Entry Share Next Entry
Python and Jython: they 're the main two
kennethhansenhp

I 've come across some differences between python and jython while amending a grinder
trial harness. Utilizing python2.5.1 I can make this to get a uri embedded in a twine:


tup = text.partition('rdf:about="')

resourceTup = tup[2].partition('")

print resourceTup[0]


partition

returns an array of substring before the centrifuge, the extractor itself, and the substring after the centrifuge.


Course, when running under jython, it would error with:
'string ' object holds no property divider '


But this works in jython:


tup = text.split('rdf:about="')

resourceTup = tup[1].split('")

print resourceTup[0]


I enquire if jython were utilise the Java Drawing category as you can apply split and joint, notwithstanding, there is no indexOf method etc as there is in the Java Threading category.


Here is a utile bid to bump out what methods an object supports


dir(str)


and can be utilized in jython to encounter out what methods a Java category supports


dir(String.class)


There are course far more key differences
between the two than itty teeny twine managing but there Holds simply one fashion to encounter out which one is best: battle


Related posts:
Couri insurance

Renters Insurance


You are viewing kennethhansenhp