Why can't I find the WATCH window? - python

I'm really new to both Python and VS Code. I'm seeing in the documentation that VS Code has a WATCH window - but I don't really see the definitive path to finding it. Can someone please help me with this?

You will find it in the debugging side bar (left-hand column by default), usually the second section from the top, when the debugger is running (see the debugging docs).

Related

PySimpleGui - window size doesnt autofit dynamically

I'm trying to auto resize a PySimpleGUI window.
consider the following:
import PySimpleGUI as sg
CommandWindow = sg.Multiline(size=(80,20),echo_stdout_stderr=True,key=OUTPUT_KEY,visible=False)
window = sg.Window("FOO", layout=[CommandWindow],element_justification='center')
when the event is triggered, a sg.Multiline element's visible trait is updated to True.
then I refresh the window and it resizes (expands) to fit the element shown inside.
when I change the visible trait to False again, the window maintain its size and doesnt shrink back.
the execution as follows:
window[OUTPUT_KEY].update(visible=True/False)
window.refresh()
I think this will perhaps be the best answer I can come up with since StackOverflow answers do not age well, especially for the PySimpleGUI project which is ever-evolving.
The Demo Browser utility is made specifically to help answer questions like this. Of course, the documentation should also be used (PySimpleGUI.org).
The Demo Programs serve many purposes. One is to show specific techniques. The Demo Browser is a way for you to quickly and easily search, edit, and execute this code.
The attached screenshot is what I see when searching for "shrink" using this tool (as of Aug 2022...). The first item answers this specific issue. Maybe I got lucky? "I would rather be lucky than good". The docs and tools provided with PySimpleGUI are the best place to turn for questions rather than SO. They'll be the most accurate, the most up to date, and are part of the project itself.
Good lucky Jedi!
what solved it for me, Thanks to #Mike from PSG,
is using:
sg.Pin(,shrink=True)
as shown in docs: https://www.pysimplegui.org/en/latest/call%20reference/#layout-helper-funcs

How to control result size when using jupyter on vsc and how to search for words in result

I'm currently using Jupytor Notebook on VSC. I found it very uncomfortable when very long result come out because I have to scroll down a long way to go the the next cell, like shown in the picture.
So I was wondering if there is a way to make the result like the original Jupyter Notebook, where they have a separate scroll for the result as shown below.
As an additional question, anyone know how to search for certain words in the result on VSC? ctrl+f only searches for words in the coding cells and not the result.
A work around for the scroll wheel if you don’t want to collapse the code is to add a print statement to the beginning and end of the code block as mentioned in Collapse Output in VS Code Jupyter Into Scrollable Window. I have not been at my computer to test this and this post is from a year ago, so I’m not sure if this solution is still working. EDIT: This solution is no longer working keep an eye on the linked issue for the resolution.
This was also brought up as an issue on GitHub and it was closed saying they have no plans to work on it currently.
#118117
As for the searching in outputs, this is an open issue currently on GitHub: #94239
Scrollable output regions would be handled in VS Code core. This function has not been decided on GitHub at present
For your additional question, I think the filter feature in the search widget might be what you're looking for - you can include outputs with that.

Is there anyway to take a screenshot of the entire console window?

I'm working on some analysis, and I'm printing things to the console in order to analyze them.
This scrolls on for anywhere from 10-30 "moves". Is there any way to somehow screenshot the entire console? What I'm currently doing is splitting it into 5+ screenshots, then stacking them all vertically in a word document. I know I could write something to essentially turn it all into HTML, but that isn't what I'm looking for. Just hoping to be able to screenshot the entire console window. (I use PyCharm for development, although I'm not sure if there is a IDE specific solution, or just an overall one)
I would just copy-paste it, but I'm using color-codes ANSI sequences for the coloring, and its not wanting to paste properly.
Not sure how effective it will for you. But
Picpack
a third part software works fine for me:-
And there a few other options too which you can try... Because In you're case such Application will be a lot of helpful.
Other software which You can use for this part:-
Apowersoft Screen Capture Pro
Blockquote
Snagit

How to focus on newly opened tab in qutebrowser?

If have just switched to the qutebrowser and I'm overly happy with it.
The one thing that is disturbing me is that I can't get the qutebrowser to focus on the tab that I've just opened.
Any idea how to do this?
Stack Overflow is about programming, and not the right place for qutebrowser questions. See getting help in the qutebrowser documentation for better places to get help.
qutebrowser usually does focus newly opened tabs by default, unless you have tabs.background set. You might be running into this issue, or it might be something different - difficult to say more without knowing what link you're opening where, and how.

Embedding Chrome browser in python QT GUI?

I have a python GUI that opens a Chrome window using Seleium. Is there any way in the PyQT GUI to embed the Chrome browser's window so there are not 2 separate windows and its just the GUI? Guessing not possible but worth it to ask.
I have been looking to do exactly the same. I don't have a complete answer but hopefully some of what I found will be of use to others who are trying to do this as well.
It IS possible to embed the window of an outside application into a Python QT application. While I could quote various reference pages I have found that the following question gives most of the information and a good starting point to find more:
QT 5.5 embed external application into QWidget
Now, that requires knowing the Window ID but that isn't too hard to find. You can do that in Windows at least as described here:
http://timgolden.me.uk/python/win32_how_do_i/find-the-window-for-my-subprocess.html
As I said, this isn't a complete answer but should put anyone else following this trail several steps closer to the complete answer. Good luck everyone and if you find the complete answer please share it.

Categories