Menu ▾ ▴

Run a program in the (new) interactive shell

Boris G
2008-06-20
2013-03-15
  • Boris G

    Boris G - 2008-06-20

    Hello,
    is it possible to run a program in the newly available interactive shell? I want to have all the variables and their values at the end of the execution to be available for the shell.

    Thanks

     
    • Fabio Zadrozny

      Fabio Zadrozny - 2008-06-21

      It's possible. In Pydev Extensions you can use Ctrl+Alt+Enter for that: http://www.fabioz.com/pydev/manual_adv_interactive_console.html -- in the open source version, you need to write the execfile() yourself.

      Cheers,

      Fabio

       
    • Boris G

      Boris G - 2008-06-22

      Fabio,
      first of all, thank you for creating and maintaining pydev.

      Now to the question,
      I'm completely new to python or to eclipse. I suppose that what you said that I had to write my own execfile(), you referred to the "initial interpreter commands" window in the interactive console options dialog. Am I right? how does the resulting console know what is the current directory of the invoking editor window?

      Thanks a lot
      Boris

       
      • Fabio Zadrozny

        Fabio Zadrozny - 2008-06-22

        Not really in the options dialog...

        You have to write in the shell (after it's open):

        execfile('path_to_editor_file')

        E.g.:

        execfile('c:/my_proj/src/my_mod.py')

        Cheers,

        Fabio

         
        • hxia

          hxia - 2008-08-05

          Hi Fabio,

          I tried to exec a file as directed. Where does the print out go? Can I still set a break points from inside the editor?
          What's the difference between "Console for currently active editor" and "Python console" when launching a new console?

          Thnaks,