jython

How to get urllib3 and requests working with jython 2.7 beta 1?

て烟熏妆下的殇ゞ 提交于 2019-12-03 08:10:24
Smart folks, I would like to use the awesome requests module in my jython program. It installs and runs just fine in python but I cannot get it to install in jython. I have tried both Jython 2.7a2 and 2.7b1 on mac and ubuntu and get the same errors related to urllib3. First installed ez_setup.py as mentioned in How can I use jython setup.py install? Then run easy_install from within the jython bin directory results in exception: NameError: name 'CERT_NONE' is not defined gautam-mbp:bin gautam$ ./easy_install requests Searching for requests Reading http://pypi.python.org/simple/requests/

Java: Scripting language (macro) to embed into a Java desktop application

强颜欢笑 提交于 2019-12-03 07:29:55
I am writing a graphics application in Java. Eventually I would like to build in a scripting language so things are programmable. Which language library do you recommend? Likely suspects are: Rhino (JavaScript) JRuby (Ruby) Jython (Python) Less likely candidates are: Whip up my own language using JavaCC LuaJava (Lua) Groovy JavaFX Script-Fu The target audience are probably not hardcore programmers, so less arcane language is preferred. My guess is that JavaScript is more acceptable by them even with its quirks just because they've seen it more. Lua seems to be popular in C/C++, but at least

What are some strategies to write python code that works in CPython, Jython and IronPython

一曲冷凌霜 提交于 2019-12-03 07:12:19
问题 Having tries to target two of these environments at the same time I can safely say the if you have to use a database etc. you end up having to write unique code for that environment. Have you got a great way to handle this situation? 回答1: If you do find you need to write unique code for an environment, use pythons import mymodule_jython as mymodule import mymodule_cpython as mymodule have this stuff in a simple module (''module_importer''?) and write your code like this: from module_importer

Security with Java Scripting (JRuby, Jython, Groovy, BeanShell, etc)

冷暖自知 提交于 2019-12-03 05:13:23
问题 I'm looking to run some un-verified scripts (written in a yet-to-be-determined language, but needs to be Java-based, so JRuby, Groovy, Jython, BeanShell, etc are all candidates). I want these scripts to be able to do some things and restricted from doing other things. Normally, I'd just go use Java's SecurityManager and be done with it. That's pretty simple and lets me restrict file and network access, the ability to shutdown the JVM, etc. And that will work well for the high level stuff I

Automated Python to Java translation [closed]

烂漫一生 提交于 2019-12-03 03:38:00
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Is there a tool out there that can automatically convert Python to Java? Can Jython do this? 回答1: It may not be an easy problem. Determining how to map classes defined in Python into types in Java will be a big challange because of differences in each of type binding time. (duck typing vs. compile time binding).

Jython saying “No visible constructors for class”

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a jython servlet as part of a large application running in tomcat5. I tested a few Spring Framework classes and create the objects in the Jython servlet. When I try to create objects of classes in the application I catch an Exception message "No visible constructors for class". These java classes do have a public constructor class, such as: public SchoolImpl() { } I create the object in python: from com.dc.sports.entity import SchoolImpl ... school = SchoolImpl() What am I doing wrong? 回答1: doublep / cluch answered the question :-) in

Using NumPy and Cpython with Jython

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I must use a commercial Java library, and would like to do it from Python. Jython is robust and I am fine with it being a few dot releases behind. However, I would like to use NumPy as well, which obviously does not work with Jython. Options like CPype and Java numeric libraries are unappealing. The former is essentially dead. The latter are mostly immature and lack the ease of use and wide acceptance of NumPy. My question is: How can one have Jython and Python code interoperate? It would be acceptable for me to call Jython from Cpython or

Jython easy_install error

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My purpose to add some python libraries to jython i.e suds package To do this tried to follow the instruction from http://www.jython.org/jythonbook/en/1.0/appendixA.html#setuptools and also checked; How can I install various Python libraries in Jython? Installed Jython 2.5.2 and added JYTHON_HOME=C:\jyhon252 to environment variables and %JYTHON_HOME%\bin to path jython is working fine. As second step tried to install easy_install on top of Jython 2.5.2 got ez_setup.py from; http://peak.telecommunity.com/dist/ez_setup.py Tried to install ez

PyDev Jython Interactive Console on Eclipse fails to be created

匿名 (未验证) 提交于 2019-12-03 02:24:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Why might my Jython Interactive Console fail to be created when called in Eclipse? Following the 'Using Jython in an IDE' instructions in the Jython manual ( http://www.jython.org/jythonbook/en/1.0/JythonIDE.html ) I have reached just before 'Listing 11-10' in the Testing section, specifically: First, click the right-most button on the console’s toolbar (you will recognize it as the one with a plus sign on its upper left-hand corner, which has the Open Console tip when you pass the mouse over it). From the menu, select PyDev Console. To the

Groovy advantages over Jython or Jruby?

感情迁移 提交于 2019-12-03 01:41:15
问题 Why would I choose to use Groovy when I could use Jython or Jruby? Does the language provide any inherent advantages to make up for the fact that Jython and Jruby skills are applicable to their parent languages outside of the JVM? Keep in mind that I purposely keeping this question generic, but if there are any advantages that exist in a particular domain, please don't hesitate to describe them. EDIT To clarify, If I write some code in Jruby, I can now, in some cases, move that code outside