PyDev: Running code to interactive console
Asked Answered
S

3

6

As my problem is quite simple I'll try to make this question simple aswell. The problem I'm having concerns the PyDev interactive console. I can bring up the console just fine without problems, and even use it as an interactive shell, just as I would be able to with IDLE. However, when I try to run my code that I've written in my project module, it won't run to the interactive console, but to the Eclipse default console. The default console displays the program just fine, but since it's not an interactive shell, I can't do anything afterwards.

With that being said, my question is: How do I get my code to run to the PyDev interactive console, and not the Eclipse default one? Thanks in advance!

Sundberg answered 26/11, 2016 at 23:2 Comment(0)
H
3

For making the symbols of the current editor available in the interactive console, use Ctrl+Alt+Enter (which will do a runfile in the interactive console context).

Also, make sure you read: http://www.pydev.org/manual_adv_interactive_console.html

Hornet answered 28/11, 2016 at 10:54 Comment(2)
Thank you for your answer, but as I said in my original post I can use the console interactively and like that it works just fine. But that's it. I can't do anything more with it. I can't debug a program using it since no code runs to it. Also thank you for the link but there wasn't really any information that would help solve my problem on the web page.Sundberg
Actually, you can have the interactive console with a debugger if you do what's suggested in "Full Debug Support in Interactive Console" in that page... I think you should add some more info to your question related to what's "I can't do anything afterwards" as I believe this question does answer what you asked for (i.e.: running the current file in the interactive console and then interactively inspect it afterwards).Hornet
L
1

First it is possible. Second, off top of my head it might be you need to change in preferences where the debug perspective points to? Look through pydev preferences too. Sorry not to be more helpful. Away from computer.

Lilialiliaceous answered 27/11, 2016 at 3:53 Comment(1)
Thank you very much for your answer! I think you might be on to something with pointing to the right perspective, and I had that thought too, but unfortunately I have no idea where to point to. In eclipse I can edit some console preferences, but I don't really understand the different commands and what information to input, as it is not simply a path to your current project or something like that. Again, I can run the console and use it, I just can't access the variables and similar things from my written code.Sundberg
L
0

Run the program from the code window. Try hitting F9 whike cyrsor in your code window. Results and bugs should show up in console.

Lilialiliaceous answered 9/12, 2016 at 23:43 Comment(1)
Thank you very much for your efforts but unfortunately none of them seem to work. As this is the case, I have solved the problem on my part by switching to Visual Studio with Python tools for my Python programming, and that has worked very well for me. Again, thank you very much for your help, but I will not pursue this issue any longer.Sundberg

© 2022 - 2024 — McMap. All rights reserved.