scyjava
scyjava copied to clipboard
⚡ Supercharged Java access from Python ⚡
This is an update of @karlduderstadt's awesome work on imagej/pyimagej#159. The goal is to make it super easy to bootstrap the [`org.scijava:scripting-python` script language plugin](https://github.com/scijava/scripting-python). It will require a little...
Let's add `scyjava.awt.invoke(python_function)` as a shortcut for `EventQueue.invokeAndWait(java_runnable_object)`, and `scyjava.awt.queue(python_function)` as a shortcut for `EventQueue.invokeLater(java_runnable_object)`. Internally it would work like this: ```python from jnius import PythonJavaClass, java_method class JavaRunnable(PythonJavaClass): __javainterfaces__...
It would be nice to support something like this: ```python >>> def fib(n): ... if n == 0 or n == 1: ... return 1; ... return fib(n - 1)...
[`eliot`](https://github.com/itamarst/eliot) might be a more powerful logging alternative. See [Eliot's Quickstart guide](https://eliot.readthedocs.io/en/stable/quickstart.html).
Some distros install jars into some location within FS. We may want to know such locatiins for different distros and load packages of any versions from there. For example ```...
Hi. I have created [JAbs](https://github.com/KOLANICH-libs/JAbs.py) some time ago to be able interface JVM code from different impls of Python: cpython + JPype and GraalPython. Basically it is an abstraction layer...
I observed last week a new problem: Maven Central dependencies are no longer loaded correctly. I first had this when making [a PR for pybacting](https://github.com/cthoyt/pybacting/pull/9#issuecomment-1173468987), but later also noted this...
I am finding myself duplicating the `constant` function to our other python components. This is WET. It would be cool if, in imglyb, we could write ```python3 @scyjava.constant def some_constant():...
[`functools.lru_cache`](https://docs.python.org/3/library/functools.html#functools.lru_cache) provides a nice way of caching function returns, and is super useful for things like [`jimport`](https://github.com/scijava/scyjava/blob/af02aaad23a76cf6b85b4b8039fd1e0ae51f3721/scyjava/__init__.py#L307). As @ctrueden noted, however: > I think [`@cache`](https://docs.python.org/3/library/functools.html#functools.cache) is the nicest. It just...
```python >>> jl = ArrayList([1, 3, 5, 7, 9]) >>> jl.toString() '[1, 3, 5, 7, 9]' >>> pl = scyjava.to_python(jl) >>> type(pl) >>> print(pl) [1, 3, 5, 7, 9] >>>...