I'm using Geany 0.18 for python developing and am in general really satisfied, but there is one little thing, that's still bugging me:
I usually use the F5 (Build-->Execute) option to test my scripts, the appearing window is rather small, and if my script prints lines which are too long they are hard to read. I would like to change the default-window size of the little one popping up if I hit F5, but I haven't found anything to accomplish this.
Is this possible at all ?
Thanks
Mischa
To solve that problem I added additional parameters to terminal command that geany runs.
In Geany go to preferences (Edit->Preferences).
Open Tools tab.
There is an input field named Terminal where you can specify terminal program to use.
I changed that to "gnome-terminal --maximize" to open terminal maximized.
For Gnome-Terminal you can find more window options running "gnome-terminal --help-window-options" from terminal.
In the window that pops up (if using windows) click on the white bar at the top (right click) this will open a menu, choose defaults then change font/font size etc.
Related
I often like to work with multiple monitors when coding in PyCharm on OSX. It's nice to have an editor window(s) on monitor A, and debug tools in monitor B, so I don't have to switch windows as much and so the debug windows have more real estate.
I'll switch back and forth between Run and Debug modes, sometimes quickly, depending on the task at hand. The main problem I find, is the tool windows for Run and Debug are separate. I have to stagger the tool windows so I can select one or the other. This requires an extra click and is an awkward arrangement on the screen.
Another option I have is to split the screen between Run and Debug tools, in which case I'm loosing real-estate.
Either way I find it's cumbersome to find the window I'm looking for. Sometimes these are hiding on a separate hidden desktop so I have to take the time to find the desktop, open the desktop, then switch to the correct tool window.
Is there any option in PyCharm to merge these two windows, either as separate tabs on the same window, or some option to have them share the same console output window?
Is there any option in PyCharm to merge these two windows
No. In the PyCharm nomenclature Run and Debug are "tool windows", not just windows. You can open each "tool window" in its own window but you can't merge 2 "tool windows".
Another thing are the "toolbars" of which you have 3, left, right and bottom. You can pin "tool windows" to the toolbars and they show like tabs but they are still separate and not merged, just tabs.
The main problem I find, is the tool windows for Run and Debug are separate.
That's a PyCharm rule an there's no way around it. Each of those "tool windows" works as a separate application/plugin. They aren't meant to be merged. The windows don't have that functionality.
The easy way to do this is using the keyboard shortcuts, Alt+4 or Alt+5 takes you to Run or Debug, Shift+F10 launches the Run config and switches focus to the Run tool window, same with Shift+F9 for the Debug tool window.
If you right-click on the toolbar and choose View Mode > Window for both tool windows you can put them on the 2nd screen over each other. That gives you maximum real-estate with 1-keyboard stroke switch and running, but not tabbed clicking.
That's as good as it gets, you can't have both tool windows tabbed on a single window outside the toolbars.
on a separate hidden desktop so I have to take the time to find the desktop, open the desktop, then switch to the correct tool window.
Having the 1-keystroke solution working would depend if the OS allows you to configure the Desktops to gain focus and come to the forefront if any of the windows in them have activity.
If not, an alternative would be a coinciding key bind where you set the Desktop containing the Run and Debug "window toolbars" to gain focus when you press Alt+4, Alt+5, Shift+F9, Shift+F10. Or changing the PyCharm shortcuts to coincide with the OS keyboard shortcuts that focus the designated Desktop.
This is mostly a question regarding work-flow in Spyder, and not a pure programming question. If anyone thinks it has no place here, then please let me know and I'll remove it.
Here we go:
I'm running Spyder on a Windows 64-bit operating system. The interaction between the Spyder IDE and IPython console depends on how you choose to run your code, and I would like to specify how this interaction works.
Among several options to run parts of the code, the difference between the following two is what puzzles me:
Option 1 - Select parts of the code and hit F9
This runs the selected code. No surprise there.
Hit F9 again, and the same selection is executed once more.
Option 2 - Run the same selection using Cells (#%%) and Ctrl+Enter
The code is run just like before. But hit Ctrl-Enter again, and nothing happens. Probably because the IPython console now is the active window.
I would like to find some way of changing this so I can use Ctrl+Enter and run the cell contents multiple times without having to make the Spyder IDE the active window by manually clicking on it. I don't know if this is possible at all. Googling and messing around in the settings under Run / configure and Tools / Preferences has so far been useless.
Thank you for any suggestions!
P.S
In case you're wondering why this is such a big deal to me, I'm rendering multiple charts and exporting them to Power Point with minor changes each time the code is run. This way, new parts of the charts (lines, textboxes, etc) are revealed when I'm working my way through a finished Power Point presentation. And for my basic data science needs, this has turned out to be a pretty much optimal work-flow. Except, of course, that I have to manually select the Spyder IDE each time I run different selections of the code.
In the latest spyder version, the keyboard shortcut to run the highlighted lines of code is F9 but it doesn't seem to work.
Go change it from TOOLS>>PREFERENCES>>KEYBOARD SHORTCUTS then double click on any shortcut you want to change and change with your shortcut. But be very careful if you used the same shortcut that is used for any other work then for that it will remove.
I changed the shortcut for 'run selection' from F9 to ctrl + Enter
in Option 2, you should use Shift+Enter instead
So, recently I was using the Python theme function for the IDLE program itself. I downloaded three themes and built my own one, which is selected now. The problem is, I forgot to set colours for the blinker and highlighting, which is hugely problematic. When I went to see if I could change back to the default setting, Python IDLE simply froze up when I selected 'Configure IDLE' under options. I can still scroll through the file, attempt to close the window and minimise it etc, but it has just frozen up. I can't close it or continue working with the file. I've removed Python and then reinstalled it but that hasn't worked, should I just manually delete the themes and force IDLE to use the original one, or is there a way to fix this?
I am running Python 2.7 on Windows 8.1.
Thanks
Turns out one way is manually deleting the faulty theme. This allows the Configure IDLE menu to open. Whoops.
I really like Geany for writing Python code. When I click F5, it opens system's default terminal window and executes the code there.
There is also a terminal inside Geany window, the bottom pane and the last tab. What I want is the code to be executed there. Is it possible?
After fiddling with the options, I found the way:
Right-click on terminal area and select "Preferences". It opens the general preferences window with Terminal tab opened.
There is an option: "Execute programs in the VTE". Checking this option does what I want.
if you are at the location of your file, just type python in that terminal.
Python for Windows by default comes with IDLE, which is the barest-bones IDE I've ever encountered. For editing files, I'll stick to emacs, thank you very much.
However, I want to run programs in some other shell than the crappy windows command prompt, which can't be widened to more than 80 characters.
IDLE lets me run programs in it if I open the file, then hit F5 (to go Run-> Run Module). I would rather like to just "run" the command, rather than going through the rigmarole of closing the emacs file, loading the IDLE file, etc. A scan of google and the IDLE docs doesn't seem to give much help about using IDLE's shell but not it's IDE.
Any advice from the stack overflow guys? Ideally I'd either like
advice on running programs using IDLE's shell
advice on other ways to run python programs in windows outside of IDLE or "cmd".
Thanks,
/YGA
For an interactive interpreter, nothing beats IPython. It's superb. It's also free and open source. On Windows, you'll want to install the readline library. Instructions for that are on the IPython installation documentation.
Winpdb is my Python debugger of choice. It's free, open source, and cross platform (using wxWidgets for the GUI). I wrote a tutorial on how to use Winpdb to help get people started on using graphical debuggers.
You can easily widen the Windows console by doing the following:
click the icon for the console window in the upper right
select Properties from the menu
click the Layout tab
change the Window Size > Width to 140
This can also be saved universally by changing the Defaults on the menu.
Year 2017-2022 Answer:
Try Visual Studio Code, it has great support for Python debugging, auto completion and more!
See this link for details:
https://code.visualstudio.com/docs/languages/python#_debugging
However, I want to run programs in
some other shell than the crappy
windows command prompt, which can't be
widened to more than 80 characters.
Click on the system box (top-left) in the command prompt and click properties. In the layout tab you can set the width and height of the window and the width and height of the screen buffer. I recommend setting the screen buffer height to 9999 so you can scroll back through a long output.
I use eclipse with pydev. Eclipse can be sluggish, but I've become attached to integrated svn/cvs, block indent/unindent and run as unittest features. (Also has F5 run)
If your comfortable in emacs though I don't see any reason to make such a major change.
I suggest instead that you replace your 'crappy command prompt' with powershell. It's not as crappy.
(As mentioned by Soviut and The Dark - you can increase the buffer width/window size to more than 80 by title-bar>right-click>Properties>Buffer Width/Window Size edit even in crappy cmd)
Wing IDE is awesome. They also have a free version.
If you ever graduate to vim, you can just run the following command to start the program you're currently editing in an interactive shell:
:!python -i my_script.py
I edit my Python programs in EditPlus. I've configured a user tool that allows me to run my program and have its output appear in a frame below my editor window. My configuration will even let you double click on an exception lines in the output to jump directly to the file and line where the error occurred. You can grab the user tool configuration I use from here on the EditPlus wiki.
Perhaps there is similar functionality you can configure that allows you to run your program and display its output in your Emacs editor!?
I replaced cmd with Cygwin and Poderosa. May be a little overkill though, if the only problem you have with cmd is that it's a pain to resize.
Although you use Emacs instead of Vim, so I guess you're into overkill... ;-)