Can I cancel Pythoninterpreter's evaluation?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can I cancel Pythoninterpreter's evaluation?

Тихомиров Валентин
I use some http://www.jython.org/javadoc/org/python/util/PythonInterpreter.html. It has methods to evaluate a script. What do you do for preliminary termination of the execution?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|

Re: Can I cancel Pythoninterpreter's evaluation?

Stefan Richthofer
Did you try to create a http://www.jython.org/javadoc/org/python/util/InteractiveInterpreter.html instead? (It's a subclass of PythonInterpreter, so features all of its methods too.) Then you can call interrupt on it, e.g. interrupt(Py.getThreadState()).
(Disclaimer: Didn't try myself, so no idea if this works as expected.)

Best

-Stefan


> Gesendet: Montag, 01. Mai 2017 um 16:31 Uhr
> Von: "Тихомиров Валентин" <[hidden email]>
> An: [hidden email]
> Betreff: [Jython-users] Can I cancel Pythoninterpreter's evaluation?
>
> I use some http://www.jython.org/javadoc/org/python/util/PythonInterpreter.html. It has methods to evaluate a script. What do you do for preliminary termination of the execution?
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Jython-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/jython-users
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users
Reply | Threaded
Open this post in threaded view
|

Fwd: Can I cancel Pythoninterpreter's evaluation?

Тихомиров Валентин
I tried interactive. It works in place of standard interpreter but its interrupt(Py.getThreadState()) does nothing. The program keeps running after it.
 
-------- Пересылаемое сообщение  --------
01.05.2017, 19:39, "Stefan Richthofer" <[hidden email]>:
 
Did you try to create a http://www.jython.org/javadoc/org/python/util/InteractiveInterpreter.html instead? (It's a subclass of PythonInterpreter, so features all of its methods too.) Then you can call interrupt on it, e.g. interrupt(Py.getThreadState()).
(Disclaimer: Didn't try myself, so no idea if this works as expected.)
 
Best
 
-Stefan
 
>  Gesendet: Montag, 01. Mai 2017 um 16:31 Uhr
>  Von: "Тихомиров Валентин" <[hidden email]>
>  Betreff: [Jython-users] Can I cancel Pythoninterpreter's evaluation?
>
>  I use some http://www.jython.org/javadoc/org/python/util/PythonInterpreter.html. It has methods to evaluate a script. What do you do for preliminary termination of the execution?
>
>  ------------------------------------------------------------------------------
>  Check out the vibrant tech community on one of the world's most
>  engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>  _______________________________________________
>  Jython-users mailing list
>  https://lists.sourceforge.net/lists/listinfo/jython-users
-------- Конец пересылаемого сообщения --------

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jython-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-users