Topics

Any restriction on network in jython scripts?


emmanuel ALLAUD
 

Hi all,

I would like to use a jython script which implements a small server on. Is is possible to import socket and select in jython?

TIA

Manu


Randall Wood <rhwood@...>
 

Those will either “just work” or not work at all. You can only python modules that have no native code dependencies (i.e. are “pure Python”) or have been provided by the Jython runtime. I don’t know if those two modules are pure Python or have or have not been provided by the Jython project.

Randall

On Jul 20, 2020, at 11:43, emmanuel ALLAUD <eallaud@...> wrote:

Hi all,

I would like to use a jython script which implements a small server on. Is is possible to import socket and select in jython?

TIA

Manu




emmanuel ALLAUD
 

Ok I'll just try and keep my fingers crossed.
Thanks
Manu

Le lun. 20 juil. 2020 à 20:35, Randall Wood via groups.io <rhwood=mac.com@groups.io> a écrit :
Those will either “just work” or not work at all. You can only python modules that have no native code dependencies (i.e. are “pure Python”) or have been provided by the Jython runtime. I don’t know if those two modules are pure Python or have or have not been provided by the Jython project.

Randall
> On Jul 20, 2020, at 11:43, emmanuel ALLAUD <eallaud@...> wrote:
>
> Hi all,
>
> I would like to use a jython script which implements a small server on. Is is possible to import socket and select in jython?
>
> TIA
>
> Manu
>
>
>
>




Balazs Racz
 

You can transliterate java into python. So you can definitely create java servers from python and make them call back to you into your python class. You can also implement a java interface (such as Runnable) with a python class and pass that into a function call on a java object from your python script.


On Mon, Jul 20, 2020 at 9:06 PM emmanuel ALLAUD <eallaud@...> wrote:
Ok I'll just try and keep my fingers crossed.
Thanks
Manu

Le lun. 20 juil. 2020 à 20:35, Randall Wood via groups.io <rhwood=mac.com@groups.io> a écrit :
Those will either “just work” or not work at all. You can only python modules that have no native code dependencies (i.e. are “pure Python”) or have been provided by the Jython runtime. I don’t know if those two modules are pure Python or have or have not been provided by the Jython project.

Randall
> On Jul 20, 2020, at 11:43, emmanuel ALLAUD <eallaud@...> wrote:
>
> Hi all,
>
> I would like to use a jython script which implements a small server on. Is is possible to import socket and select in jython?
>
> TIA
>
> Manu
>
>
>
>




emmanuel ALLAUD
 

Hi,
I want to do something very simple: the jython script will implement a server to which "real" python scripts connnect, these will handle the bus of devices (the plan is arduino on rs485 with a special protocol I already talked about).
The jython script will just be in charge of sending things like "AT1:23,1" meaning throw turnout 23 on node 1, and setting sensors from messages received via the client's connections.
Basically I need sockets, select, strings and dictionaries.
Thanks,
Manu

Le lun. 20 juil. 2020 à 21:35, Balazs Racz <balazs.racz@...> a écrit :
You can transliterate java into python. So you can definitely create java servers from python and make them call back to you into your python class. You can also implement a java interface (such as Runnable) with a python class and pass that into a function call on a java object from your python script.

On Mon, Jul 20, 2020 at 9:06 PM emmanuel ALLAUD <eallaud@...> wrote:
Ok I'll just try and keep my fingers crossed.
Thanks
Manu

Le lun. 20 juil. 2020 à 20:35, Randall Wood via groups.io <rhwood=mac.com@groups.io> a écrit :
Those will either “just work” or not work at all. You can only python modules that have no native code dependencies (i.e. are “pure Python”) or have been provided by the Jython runtime. I don’t know if those two modules are pure Python or have or have not been provided by the Jython project.

Randall
> On Jul 20, 2020, at 11:43, emmanuel ALLAUD <eallaud@...> wrote:
>
> Hi all,
>
> I would like to use a jython script which implements a small server on. Is is possible to import socket and select in jython?
>
> TIA
>
> Manu
>
>
>
>