Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Advanced Scripting Environment (EASE) » Process standard input (Python)(Need that Python code run with EASE processes standard input outside of Eclipse)
Process standard input (Python) [message #1855736] Sat, 29 October 2022 21:02 Go to next message
Jamil Raichouni is currently offline Jamil RaichouniFriend
Messages: 2
Registered: October 2022
Junior Member
Hi!

I already discussed that topic within the issues area of the python4capella repository on GitHub:

https://github.com/labs4capella/python4capella/issues/155#issuecomment-1291765346

In short:
I cannot get EASE to run a Python script that accepts and processes standard input.

Two very simple and clear scenarios:

Accept and process end user input:

#!/bin/bash
APP=org.eclipse.ease.runScript
echo "print(input("Enter something to be printed: "))" > ./debug.py
/path/to/eclipse -consolelog -application $APP -script "file:$(realpath ./debug.py)"


Access and process developer input (debugging):

#!/bin/bash
APP=org.eclipse.ease.runScript
echo "breakpoint()" > ./debug.py
/path/to/eclipse -consolelog -application $APP -script "file:$(realpath ./debug.py)"


In both cases it is possible to enter something into the terminal and hit the enter key. The issue is that nothing happens then.

Being able to pass standard input to a script run in EASE is especially important to debug code.
One common use case is that stuff runs headless (e. g. in a Docker container) and one needs to set a breakpoint and debug the code using Python debugger pdb.

Many thanks and keep up the good work!
Jamil
Re: Process standard input (Python) [message #1855869 is a reply to message #1855736] Tue, 08 November 2022 10:47 Go to previous message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 250
Registered: July 2009
Location: Graz, Austria
Senior Member
Not able to to test this in the next days, but reading input using the python methods will not work for sure. Java is the main executing application here and python is running in a separate process, not connected to the Java I/O streams directly. Try to use readInput() from the Environment module.

HTH
Christian

[Updated on: Tue, 08 November 2022 10:48]

Report message to a moderator

Previous Topic:How many core contributors/ maintainers are there for EASE
Next Topic:Eclipse Editor does not recognize js file
Goto Forum:
  


Current Time: Mon Oct 07 21:00:04 GMT 2024

Powered by FUDForum. Page generated in 0.03621 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top