How can save to file the on screen output of a Python IDE? - python-2.7

I use Spyder as my Python IDE. In most of what I do I use the editor to write code and execute portions of the program one at a time. I typically go back and forth, change things, add pieces, execute portions... you get it. Is there a way to save to file what Spyder shows in the console portion of the IDE after each portion of code is executed?

(Spyder dev here) Well, there is a way to save the output shown in our consoles but not after each execution. You have to do it manually, like this:
For our Python consoles, you need to do a right mouse click over any console and select the option Save history log.
For our IPython consoles, you need to do a right mouse click over any console and select the option Save as HTML/XML

One way to capture entire console output of Sypder IDE:
1. Go to "Profile" (Shortcut: F10) under "Run" Tab.
2. On Right hand side, you can see Run, Stop and Output buttons.
3. Click on Run and the entire console session is captured under Output.
Hope, this helps. Kindly correct me if I am wrong.

Related

Codelite page gone blank

I have been writing code in codelite for c++ since past 20 days, today morning while writing code, by mistake i clicked somewhere and the top menu of options and side menu of projects vanished. I tried many things but i couldnt get them back. I am not a technical person and learning c++ from a tutorial. Now my codelite page is blank and i am stuck. I have unistalled and installed again but when i opened it, it still shows the blank page . I dont know what to do. Is there any history i need to delete from my laptop(for reinstallation) or need to do something in codelite , to get back default codelite page which comes when newly installed.Please help.
might be a little late here but I think I had your problem, if someone encounters similar
Double check what "perspective" you are on
Ctrl + M key can minimize several open views such as the "workspace view" and the "debugger view"
It's pretty simple, this happened to me too. It happens just because you are on full screen mode, and because you are currently in the workspace folder in which your source code is. Just follow these:
press Alt+M to you exit full screen mode. You should now be
able to view the top menu.
now go to view in the top menu and click on the Workspace pane.
After the Workspace pane appears, you will notice that you are now
in the workspace folder rather than on the source code file. Now, to go
to the file, click on the workspace on which your file is, click on
the project name under which your source code is, click on src,
then click on the file, e.g. main.cpp
Post your doubts if you still have any

Qt: How to Write a Windows Desktop Utility?

I've used Qt for widget development a fair bit. That's straightforward. But how could I write a program that can be invoked from anywhere on Windows?
Say I've selected some text in a web browser. I want to be able to invoke my program via keystroke, maybe show a little list containing a list of text files I can select (ideally where the cursor is), and then add the selected text to that file.
How can I do this?
I suggest you to have a look at:
https://skycoder42.github.io/QtService/index.html
https://forum.qt.io/topic/67043/qt-daemon

How to highlight everything up to a certain point

I am new to SAS Enterprise Guide, and I'm beginning to get familiar with some of the useful keyboard shortcuts. I just figured out that Shift+F8 highlights the current step and F8 runs it, but I was wondering if there is a way to set up a shortcut that highlights the current step AND everything before it.
For those of you familiar with RStudio, what I'm looking for is analagous to the "Run all chunks above" option.
Thanks!
I've tried looking at the Macros menu to see if there is an existing option, but I didn't find one.
CTRL+SHIFT+HOME will select everything from a line up to the start of the program

Why isn't my terminal running my updated C++ code?

I am a new programmer and I am trying to use the terminal on my Mac to compile and run the C++ code I write using the Sublime text editor.
I am able to get my code to run using the terminal, however, whenever I make changes to my code on sublime and then re-compile it on my terminal, my terminal doesn't recognize my changes and keeps on running my original code.
Does anyone know what might be happening?
Thank you so much!
I can think of two possibilities that spring immediately to mind. If you're changing your code in the editor, and that's not being reflected in the compilation, then it's likely to be one of the following. Either:
you're not saving the file in the location you think you are; or
you're not saving the file at all.
The easiest way to tell if one of these is the case is to introduce an error into your code(a), like:
int my hovercraft = full of eels;
and make sure the compiler complains about it.
If you're not saving it at all, do so. If you're saving it in the wrong place, you can usually find out where just by doing a Save As and seeing where the default location is.
If you're annoyed that you have to save, and that computers should just "work"(b), Sublime Text has an auto-save feature that may come in handy, courtesy of one Lucy Bain. Instructions (paraphrased) are duplicated here in case that site ever disappears:
Open Sublime
Find Settings and edit the user window (under Sublime Text 2 > Preferences for Mac, just Preferences for Windows).
Add the line "save_on_focus_lost": true.
Save and close the file.
At that point, whenever you click away from a particular file, it should save it.
(a) Some developers seem to have little trouble doing this without even trying :-)
(b) A not unreasonable expectation for a Mac user :-)

what is a good editor besides eclipse for printing clojure code?

I like clojure and use textmate/sublime text but every time I print out the source code, it is not syntax colored and the lines are all messed up. Is there an online/offline editor that does the job? I don't want to load up eclipse everytime I want to print something
I've printed code from Emacs before quite successfully. M-x print-buffer ought to do it.
You might also be able to paste your code at refheap and click the 'maximize' link and print from there, but it doesn't word-wrap.
Refer to http://stuff.mit.edu/people/lucylim/emacs_print_syntaxhighlighting.html for Emacs printing with color.