Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » newbie: external tools: output no shown in console
newbie: external tools: output no shown in console [message #334177] Fri, 23 January 2009 12:55 Go to next message
Martin Trummer is currently offline Martin TrummerFriend
Messages: 5
Registered: July 2009
Junior Member
hi,

OBJECTIVE:
I wrote a simple pyhton script and want to execute this as external tool.

DETAILS:
Since I cannot select the pyhton script directly, I set the Location of
the external tool configuration to my python.exe and pass the script name
as argument.
That works fine - although I am not sure, if there's a better way to do
that - or why I can't use the pyhton script as external tool location
directly.

anyway - my testscript is very simple: prints to stdout, stderr, and waits
for userinput:
>>>

import sys

print "stdout"
print >> sys.stderr, "stderr"
raw_input()
print "stdout2"
print >> sys.stderr, "stderr2"

<<<

PROBLEM:
The problem is, that the script is started: eclipse switches to the
console: but the console does not show any output - but I know that it has
reached the code where the script is waiting for input.
when I then press Enter in the console, the script continues and now I see
the complete output:
>>>
stderr
stderr2
stdout
stdout2
<<<

Does anyone know what the problem is?
I am using eclipse 3.4.0 (ganymede)

Note: I have activated Allocate Console in the Common tab of the External
Tools Configuration.

BTW: I hope this is the correct group for my question, if not, please tell
me where to post this question instead
Re: newbie: external tools: output no shown in console [message #334232 is a reply to message #334177] Wed, 28 January 2009 09:52 Go to previous message
Martin Trummer is currently offline Martin TrummerFriend
Messages: 5
Registered: July 2009
Junior Member
the solution for this is, that I must flush the streams before waiting for
userinput:
<pre>
sys.stdout.flush()
sys.stderr.flush()
</pre>

I just got confused, because it works without flushing on the commandline
Previous Topic:Formatting a large number of files with Eclipse
Next Topic:Common Navigator - M5 - checking for objects that don't have content extensions
Goto Forum:
  


Current Time: Fri Apr 26 08:40:10 GMT 2024

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

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

Back to the top