jython

Jython @property SyntaxError: mismatched input '' expecting CLASS

匿名 (未验证) 提交于 2019-12-03 01:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried to run this example from the docs in the Jython interpreter: http://www.jython.org/docs/library/functions.html class C(object): def __init__(self): self._x = None @property def x(self): """I'm the 'x' property.""" return self._x @x.setter def x(self, value): self._x = value @x.deleter def x(self): del self._x Just entering the first 4 lines (up to and including @property ) yields a SyntaxError: >>> class C(object): ... def __init__(self): ... self._x = None ... @property File "<stdin>", line 4 @property ^ SyntaxError: mismatched

Getting started with Pylint for Jython (jython2.5.1)

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: We have a ton of Jython scripts for our deployment automation; I'd like Pylint to be part of our build pipeline. I downloaded and installed logilab-astng, logilab-common and pylint from here: http://www.logilab.org/857 I installed the logilab libraries successfully using: jython setup.py install However, when I attempt to install pylint i get the following output: C:\temp\pylint-0.22.0.tar.gz\pylint-0.22.0>jython setup.py install running install running build running build_py package init file '.\test\__init__.py' not found (or not a regular

windows下Jython安装

匿名 (未验证) 提交于 2019-12-03 00:18:01
下载Jython http://www.jython.org/downloads.html 此处可下载Jython最新版本,本文下载的版本为jython-installer-2.7.0.jar 安装Jython 打开cmd,切换到jdk的目录下,并将jython-installer-2.7.0.jar放置该目录下,执行jar文件 C:\Users> F: F:\>cd /JAVA/eclipse/jdk-1.8.0/bin F:\JAVA\eclipse\jdk-1.8.0\bin>java -jar jython-installer-2.7.0.jar F:\JAVA\eclipse\jdk-1.8.0\bin>dir F:\jython2.7.0 在/python2.7.0/bin目录下输入jython即可使用 文章来源: windows下Jython安装

Jythonc missing

偶尔善良 提交于 2019-12-02 23:10:53
I just installed Jython 2.5.1. I want to convert my Python file into Java class file and it is instructed on the website to use the jythonc command-line tool but I can't find it. Does anyone know where I could find it? Basically what i was trying to accomplish is to get my Python code running client-side in a browser and the best way seemed to be by creating an applet using Jython. I don't want to create a desktop application and using Silverlight/IronPython is out of the question. Any other ideas are welcomed. Cheers! Jythonc was removed in Jython 2.2 and is no longer supported. The official

Email an attachment in R with gmail

☆樱花仙子☆ 提交于 2019-12-02 22:11:47
I am desiring to send an email in R with an attachment using gmail. I have found that sendmailR does not work with gmail because it requires authentication (I couldn't get it to work with gmail so I assume this to be true unless someone tells me I'm wrong , in which case I'll post the R output and error message for that). I found a code snippet found here (LINK) . As the site suggests the code is not formatted to send attachments but I have got it to send an email. I'd like to extend this code to send attachments (in an email correspondence the author of this code was unable to extend the code

python UDF version with Jython/Pig

痴心易碎 提交于 2019-12-02 21:13:32
问题 When I do Python UDF with Pig, how do we know which version of Python it is using? Is it possible to use a specific version of Python? Specifically my problem is in my UDF, I need to use a function in math module math.erf() which is newly introduced in Python version 2.7. I have Python 2.7 installed on my machine and standalone Python program runs fine but when I run it in Pig as Python UDF, I got this: AttributeError: type object 'org.python.modules.math' has no attribute 'erf' My guess is

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

我与影子孤独终老i 提交于 2019-12-02 20:45:59
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? 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 import mymodule This way, all you need to do is alter module_importer.py per platform. @Daren Thomas: I

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

跟風遠走 提交于 2019-12-02 18:31:08
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 want to block off. But there is some stuff I want to allow, but only via my custom API/library that I've

Automation Script: If FieldA = 1, then set FieldB to 'one'

前提是你 提交于 2019-12-02 18:29:51
问题 I'm trying to break down this problem into manageable parts: Maximo spatial query. I think the first step is to create an automation script that does this: Takes a value from a field Does something with it Returns a value to a different field For example: Create a new work order Manually enter the WONUM as 1 Save The action of saving automatically triggers an automation script The script checks to see if the WONUM = 1 If true, then the DESCRIPTION is populated with the word one How can I do

jdbc: Get the SQL Type Name from java.sql.Type code

淺唱寂寞╮ 提交于 2019-12-02 18:00:31
I have an array with Field Names and jdbc Type codes. (Those int codes that you can find in http://download.oracle.com/javase/1.4.2/docs/api/constant-values.html#java.sql.Types.BIT I use a level 4 Driver. I can't figure out how to ask the driver for the corresponding SQL (DDL) Type names. It would be useful in jdbc and in native dialects. I have (CustomerId, 1) (CustomerName, -8) and I want (customerId, INT) (customerId, VARCHAR(200)) Where can I find functions that help me with that? I am using jdbc in jython via zxJDBC, so I can use all java and python DB API 2.0 functionality. You seem to