windows-console

How to stop running Python .pyw script which doesn't have GUI window?

烂漫一生 提交于 2021-02-17 05:40:09
问题 I have created a script in python and saved it as .pyw file so that I don't need console to execute the script. I am wondering how to stop the execution once it is running. What I am doing right now is opening the IDLE and closing it and it seems to work. I am sure there is a better way of doing this. Can somebody advise me about this? 回答1: As it says in the docs The Python installer automatically associates .py files with python.exe so that a double-click on a Python file will run it as a

How to stop running Python .pyw script which doesn't have GUI window?

狂风中的少年 提交于 2021-02-17 05:40:07
问题 I have created a script in python and saved it as .pyw file so that I don't need console to execute the script. I am wondering how to stop the execution once it is running. What I am doing right now is opening the IDLE and closing it and it seems to work. I am sure there is a better way of doing this. Can somebody advise me about this? 回答1: As it says in the docs The Python installer automatically associates .py files with python.exe so that a double-click on a Python file will run it as a

Windows console “ESC[2J” doesn't really “clear” the screen

南楼画角 提交于 2021-02-10 16:13:46
问题 I know this kind of questions are asked frequently, but I think this one is a little different and needed to be asked. The new Windows console supports ANSI (VT100) control codes: ANSI/VT100 control codes & Windows document: the control codes. However, ESC[2J doesn't really "clear" the screen, it just scrolls down to "hide" printed contents. Only ESC[H + ESC[J really "clears" the currently showed contents on the screen. Is this a bug or it is designed to do this? Is it written on some kind of

Windows console “ESC[2J” doesn't really “clear” the screen

纵然是瞬间 提交于 2021-02-10 16:10:52
问题 I know this kind of questions are asked frequently, but I think this one is a little different and needed to be asked. The new Windows console supports ANSI (VT100) control codes: ANSI/VT100 control codes & Windows document: the control codes. However, ESC[2J doesn't really "clear" the screen, it just scrolls down to "hide" printed contents. Only ESC[H + ESC[J really "clears" the currently showed contents on the screen. Is this a bug or it is designed to do this? Is it written on some kind of

Can't center my console window by using the following code

杀马特。学长 韩版系。学妹 提交于 2021-02-08 12:01:50
问题 void Initialize_Window(void) { RECT rConsole; GetWindowRect(GetConsoleWindow(), &rConsole); SetWindowPos(GetConsoleWindow(), NULL, 0, 0, 800, 700, 0); SetWindowLong(GetConsoleWindow(), GWL_STYLE, GetWindowLong(GetConsoleWindow(), GWL_STYLE) & ~(WS_SIZEBOX | WS_MAXIMIZEBOX)); SetWindowPos(GetConsoleWindow(), NULL, (GetSystemMetrics(SM_CXSCREEN) - rConsole.right - rConsole.left) / 2, (GetSystemMetrics(SM_CYSCREEN) - rConsole.bottom - rConsole.top) / 2, 0, 0, SWP_NOSIZE); } I'm trying to center

Can't center my console window by using the following code

倾然丶 夕夏残阳落幕 提交于 2021-02-08 12:01:19
问题 void Initialize_Window(void) { RECT rConsole; GetWindowRect(GetConsoleWindow(), &rConsole); SetWindowPos(GetConsoleWindow(), NULL, 0, 0, 800, 700, 0); SetWindowLong(GetConsoleWindow(), GWL_STYLE, GetWindowLong(GetConsoleWindow(), GWL_STYLE) & ~(WS_SIZEBOX | WS_MAXIMIZEBOX)); SetWindowPos(GetConsoleWindow(), NULL, (GetSystemMetrics(SM_CXSCREEN) - rConsole.right - rConsole.left) / 2, (GetSystemMetrics(SM_CYSCREEN) - rConsole.bottom - rConsole.top) / 2, 0, 0, SWP_NOSIZE); } I'm trying to center

How to get rid of “Command Line” window when running Python script with GUI? [duplicate]

让人想犯罪 __ 提交于 2021-02-07 18:38:44
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How can I hide the console window in a PyQt app running on Windows? I am programming under Python2.6 + PyQT + Eric4 environment. All the GUI and Program parts are done, but here is the problem. When I run my program, two windows pop up. One is the window (or frame) I want, the other is like a python interpretor window having a all black undergroud color. And I really don't want this to show. What can I do to get

How can I get the mouse position in a console program?

我的未来我决定 提交于 2021-02-05 09:43:25
问题 How can I get the mouse click position in C++ in a Windows console program? (A variable that returns the position of the mouse when clicked) I want to draw a menu with simple text commands, so when someone clicks, the game will register it and know the position. I know how to do everything I need to do except get the mouse position when clicked. 回答1: You'll need to use the *ConsoleInput family of methods (peek, read, etc). These operate on the console's input buffer, which includes keyboard

Masking the user input as asterisks in Windows?

淺唱寂寞╮ 提交于 2021-02-05 06:43:26
问题 I need to create a simple password program where the program asks user to input password and when user inputs, it shows the characters as asterisks. Every tutorial out there uses getch() (in conio.h ). But I don't want to use it. Is there any easy alternative for doing so? I'm using Windows 10. P.S: Please don't confuse this to be a duplicate of this question: Alternative function in iostream.h for getch() of conio.h? Because that question asks for holding screen output whereas I need to mask

Masking the user input as asterisks in Windows?

落花浮王杯 提交于 2021-02-05 06:43:24
问题 I need to create a simple password program where the program asks user to input password and when user inputs, it shows the characters as asterisks. Every tutorial out there uses getch() (in conio.h ). But I don't want to use it. Is there any easy alternative for doing so? I'm using Windows 10. P.S: Please don't confuse this to be a duplicate of this question: Alternative function in iostream.h for getch() of conio.h? Because that question asks for holding screen output whereas I need to mask