How to deactivate JLine for Jython interactive interpreter session? - jython

Jython 2.5 comes with JLine per default.
I would prefer to use the interactive interpreter with rlwrap. It seems that rlwrap is not working if JLine is active.
In Scala I would use rlwrap scala -Xnojline.
Is there a similar option for Jython to deactivate JLine?

You can set the jython property python.console to
org.python.util.InteractiveConsole. This was the default in Jython
2.2 and is a simple history-less console. You can set this property via the command line like:
jython -Dpython.console=org.python.util.InteractiveConsole
or change the property in your local registry. See
http://wiki.python.org/jython/UserGuide#the-jython-registry

Related

clojure.lang.Repl deprecated in IntelliJ with Cursive

When I run the Cursive repl in IntelliJ, the following warning is displayed:
WARNING: clojure.lang.Repl is deprecated.
Instead, use clojure.main like this:
java -cp clojure.jar clojure.main -i init.clj -r args...
Does anyone know how to resolve this issue within IntelliJ?
To get to this point I:
Followed the Cursive instructions for setup.
Double-checked that lein repl works from my terminal.
Double-checked that the Cursive repl is running on the correct namespace.
Researched and found many workarounds relating to a similar issue in the actual Clojure Framework.
For the time being, in order to execute (-main) from the repl I am first running (in-ns 'fileName) to enter the correct namespace and then executing the -main function. I have found this preferable to typing out the full (fileName/-main) every time, but this is still not an ideal workaround.

Datastax DSE: dse spark-submit ignores java properties passed

I have setup a simple project to expirement with spark. I use dse 4.6.2 (3).
When i submit the jar with the following command (in stand-alone mode not yarn):
dse spark-submit --driver-java-options "-Dloggging.path=/home/$USER/log/" --class com.SimpleSparkApp my.jar
The property logging.path appears in spark.driver.extrajavaoptions so i can do sys.pros.get("spark.driver.extrajavaoptions") and parse the string, obviously not the best thing to do. On the other hand, the property does not exist when i search for it with sys.props.get("loggging.path")...
Shouldn't the properties be applied to the driver's jvm?
Any ideas?

Cannot auto configure pydev in eclipse

I have installed PyDev successfully, I have python 3.4.0 installed successfully and the folder containing python.exe is in my path and I can run it from the command line.
However, when I go to window\preferences\pydev\interpreters\python interpreter and select 'quick auto-config' to configure it using normal python I get an error saying 'auto configurator could not find a valid interpreter... Note the system environment variables used for Jython are PATH and PYTHONHOME.'
Unless this is a bug in the text I am not selecting Jython (I get a different error if I select IronPython, btw, so this is not a generic error message).
The trace is as follows:
Errors getting info on discovered interpreter(s).
See error log for details.
java.lang.RuntimeException: java.io.IOException: Cannot run program "python": CreateProcess error=2, The system cannot find the file specified
As I say, python.exe is in my path.
You have to install the actual python package separately from here https://www.python.org/download
Close LiClipse/Eclipse => Download Python Here: https://www.python.org/download
=> reopen LiClipse => Auto Config for the interpreter Will WORK!
I found the answer, but I'll leave this up in case anyone else gets it. It's a pretty stupid auto config option if you ask me ;)
In the higher level window\preferences\pydev\interpreters\ preference you need to untick jython and ironpython.
No idea why given I selected the Python sub-preference specifically.

jython and jython-apt

i am trying to get jython running with the apt-module from python.
I have standard python2.7 installed as well as jython2.7. When running import apt in python everything is ok, but when running it in jython the module is not found. When extending the sys.path to the python2.7-installation like /usr/lib/python2.7/dist-packages the apt-package is found but it complains about not finding the apt-pkg-package (which is just some simple .so-file and not a real "package" in python).
What can be done here?
apt_pkg is required by apt, and only implemented as a binary module. Unfortunately, jython cannot load these, so you're out of luck. You can either port apt_pkg to Java (you can simply create a shim with JNI), to pure Python, or use another mechanism (for example calling an apt frontend on the commandline and parsing its outputs).

Running Monkeyrunner from pydev

Hi I want to run python scripts developed from Monkeyrunner in Eclips-Pydev setup.
I have installed Jython and mapped the Jython interpreter and added the Monkeyrunner.jar to Pydev also.
But still I'm not able to import com.android.monkeyrunner package in Pydev.
Any Help??
Regards,
ram
At First You have to set the path of monkeyrunner which is :
export PATH=/home/<Directory name where android-sdk is located>/android-sdk-linux_x86/tools:$PATH
After that open your terminal and run the command monkeyrunner