Pydev - startup - console

Maybe I got simple questions so I googled it but I can't find answer.
I am using Pydev/Eclipse and I want to run the script within Console.
First I want to modify the startup of the session - it means some modules are loaded during start (math, numpy, scipy, etc...).
Where/how can I modify Pydev Console startup?
Secondly, I execute the script using righ-click on script file and "Run as -> Python Run" then it's executed within console and terminated. So I want to stay within Console and to be interactive and not be terminated.
How can I get such feature?
Thank you!
Best regards,
Peter

The startup configuration can be found in the PyDev preferences menu. The preferences can be found in the upper menubar under 'Window'.
Window -> Preferences -> PyDev -> Interactive Console
There you will find a big text input field with a label 'Initial interpreter commands'. Often it is allready in use and imports sys only to print the name and version number of the starting console.
The only solution I am aware of for staying connected with your script is to set a breakpoint at the end and start your script in debug mode. But maybe there is another way. To do so just double click at the left corner of the editor window with your script opened. A green dot will appear marking a breakpoint. Now right click an choose 'Debug As'. Your script will run till the line is reached where you have set the breakpoint.
Hope I could help.

I think that what you want is the interactive console. See: http://pydev.org/manual_adv_interactive_console.html
You can configure the initial commands in the preferences page.

Related

Goland run config console is wrapping lines before the end

For some reason the Goland console has started adding a line wrap well before the end of the screen when I run a debug configuration:
This is not happening when run the same command in another terminal or IDE, and I can't find any docs on settings I might have tweaked to make this happen. How do I get it to stop wrapping the lines like this?
It is a known issue in GoLand. Feel free to follow GO-12814.
As a workaround, you can invoke Help | Find Action | Registry, find go.run.processes.with.pty and disable it.

Debug certain lines in RTVS (R Tools for Visual Studio)

Currently the only way to debug in RTVS is to first attach the debugger and then source the file, as shown in this official manual. However, this is rather inconvenient, since my script usually expands to hundreds of lines and it will take forever for the debugger to execute to the breakpoint, which usually at the last of the script.
The only workaround I can come up with now is to comment all the above lines before the codes of interests. But, is there any elegant way to achieve that?
So far there is no shortcut for it yet, to debug the certain line in R, we still have to launch the debugger with the code in script.R by either selecting the Source startup file button on the toolbar, selecting the Debug > Source startup file menu items, or pressing F5. Visual Studio enters its debugging mode and starts running the code. It stops on the line where you set the breakpoint:
https://learn.microsoft.com/en-us/visualstudio/rtvs/getting-started-with-r#debugging-your-code

Creating an executable R-file

I want to make an executable R-file (for automation purposes). Therefore I concluded the following tutorial.
After completion however nothing happens... Only the .Rexec file opening in RStudio (in stead of running it and showing me the pop up...
Any more people experienced this? Any clues to where to look to fix this?
The tutorial you gave is useful. However, it missed something.
After done all the things in that blog, you still need to do one more thing. Right click on the "test.Rexec" file and choose "open with" and then select "RScript". Maybe you need to find RScript in your system which is usually here:
C:\Program Files\R\R-3.2.1\bin\Rscript.exe
Remeber to check the "Always use the selected program to open this kind of file".
Next time, when you double click the "test.Rexec" file, evethying would be okay.
I found no need to create Rexec file.
I created .bat file and then set it up in Task Scheduler.
The .bat file opens up the Rscript.exe, as shown in prev answer above. The .bat file then points to the .R file, that I want to be executed.
For some time, I could not get it to work, but solution was to point to Rscript.exe as mentioned above. Then it will not open up in compiler.
Works fine for me.

How to tell Atom to not remember last opened project?

I would like to retrieve the welcome screen (and only it) when I start Atom. That way, I'll be able to choose the project I want to work on each time I start Atom (currently, I have to close the project opened the last time).
I already re-enabled the Welcome package in the init.coffee file so I see the welcome screen each time I start Atom, but there are two problems.
First: this screen is now shown every time I open a new window, so every time I open another project than the current one (I use Projects Manager if it matters). It's not very useful, as I only want to see this screen when I start Atom.
Second: I see the welcome screen on start, but only as new tabs in the last opened project, so the problem remains the same.
Has someone a solution?
The setting you are looking for is Settings > Open Empty Editor On Start, which is on the Core Settings page, right under Ignored Names. Make sure to enable this setting, i.e. check the box. Whenever you start Atom from its icon now, it will start with an empty editor, and will not reopen your previously used files.
I came across this problem, too.
But I found that if I had 'openEmptyEditorOnStart: true' in the config.cson file, and each time I quit the Atom I did "Remove Project Folder" in the "Tree View", next time I opened the Atom edit, I can open it without the last opened project.
Hope it helps. :)
Proper configuration to get empty editor on every start:
✔️ Open Empty Editor On Start
✖️ Restore Previous Windows On Start
Just go to File > Reopen Project > Clear Project History. It worked for me.
I just switched of package tree view
Setting/packages tree-view - disable
And when open Atom it is free of project tree
You need to do both in Core settings:
check Open Empty Editor On Start
set Restore Previous Windows On Start to no

Consoles and Tabs

When I start the tomcat server from console using the startup.bat script, a new command window opens which is filled with java logging statements.
I use Console2 which leverages tabs for each open console window. Is it possible to let the java system create a new tab within console2 instead of just opening a new command window?
This has nothing to do with java, its merely down to the way the catalina.bat is called from startup.bat
catalina.bat can be called with either a "start" argument or a "run" argument.
run Start Catalina in the current window
start Start Catalina in a separate window
So open startup.bat, scroll to the bottom you should see
"%EXECUTABLE%" start %CMD_LINE_ARGS%
change that to
"%EXECUTABLE%" run %CMD_LINE_ARGS%
exit
I add an exit after to close the calling window.
Unless Console2 hooks any APIs that create console windows – no. And that's also highly unlikely that they do or even can. Console2 does nothing more than hook up input and output of console windows. What the programs in those do is beyond what it's interested in.

Resources