[Eric] Is execute in command windows possible?

Detlev Offenbach detlev at die-offenbachs.de
Thu Jun 14 18:39:21 BST 2007


On Mittwoch, 13. Juni 2007, Laurent Dufréchou wrote:
> Detlev Offenbach a écrit :
> > On Dienstag, 12. Juni 2007, Laurent Dufréchou wrote:
> >> Hi there,
> >>
> >> I'm new user to eric4.
> >> I'm wondering if it's possible to do a 'run in console window' that
> >> launch the program in a konsole prompt under linux or cmd prompt under
> >> windows??
> >> (I'm currently under windows for my test)
> >> My need is to be able to launch the program in a classical prompt
> >> independant from eric.
> >>
> >> Moreover here my script:
> >> print "hello"
> >> raw_input("push a key")
> >> print "program done"
> >
> > Why can't you run this script in the debug client? The output would go to
> > the shell window, so you can enter your stuff there.
>
> Hello detlev,
>
> what do you mean by debug client? Is this what I get when when I push F2?
> All my ouput and input goes to the eric "shell" window, is this this?

When eric runs, it starts another python interpreter and talks to it via a 
network connection. You are communicating with this via the shell window. 
When one of the run, debug, ... actions is activated, the script is started 
in the background interpreter. If this script crashes (even with a seg fault) 
no harm is done to eric. If the background interpreter hangs for some reason, 
just use the shell context menu to kill it (reset entry).

If you want to have the interpreter output in a separate terminal window just 
configure this on the Debugger -> General (Part 2) page.

>
> In fact, I prefer not to have the output of  my script in this shell for
> these reason:
> 1) if my script is (very buggy) and do a segfault. (it is posible if for
> example I'm doing a swig wrapper with some error in it that acces wrong
> value in unautorized access). Then it will segfault eric no?

No (s.above)

> This is not the most 'problematic' (i've put quote because i can do with
> it but ... ;) )
>
> 2)I like to do sometimes the following:
> Launch my script in an independant environment (a cmd shell) and a the
> end the shell still opened.
> I can then modify my script and then launch another time my script it
> will appears in an another independent cmd prompt.
> I can then compare the two results. <-- realy cool sometimes!!!
>
> 3)Small script development:
> I like the idea to have the eric shell to test some piece of code, when
> they are ok i add them to the editor.
> When I'm satisfied I launch the script inthe independant shell. Result
> bad? ok I continue to work in the eric shell without having been
> dsiturbed by this "try and see what happens". <-- really cool to !
> Perhaps it's not a good way of programming but i like it as I go really
> faster! :)
>
> The main idea is eric shell is to try some command, execute in terminal
> to rapid do a try!
>
> I asked this because I was used to use SPE before trying eric, and it
> has by default the same behavior as eric, but it as also an option
> (alt+F9) that permits to launch the script in an independant terminal,
> option that i found really handy.
>
> That's all.
>
> Thanks  anyway for your time!
> Laurent
>
> >> How can I redirect this to the log viewer stdout/in eric windows?
> >
> > These outputs are for the integrated tools or if some other tools are
> > started that output directly to eric.
> >
> >> (i
> >> didn' manage to use it!)
> >>
> >> By the way, just a little usability idea :
> >> Perhaps, could be a good idea to add a little text like "script
> >> terminated" in the eric python interpreter when script is done. could be
> >> usefull to know when F2 command has been terminated.
> >
> > Something like that is shown, if the script is run in debug mode.
> >
> > Detlev



-- 
Detlev Offenbach
detlev at die-offenbachs.de



More information about the Eric mailing list