windows-console

How to format text using std:out setfill std::setw std:right with one padding space

萝らか妹 提交于 2019-12-12 15:15:13
问题 I just want to format a string and an integer value with right justify. There is no problem to do this without leading space before the integer value. bytes.....................123981 total bytes..............1030131 But it should look like this: bytes ................... 123981 total bytes ............ 1030131 Unfortunately the example below wont work, because setw (right justify) relates only to the next stream element. int iBytes = 123981; int iTotalBytes = 1030131; cout << setfill('.');

How to integrate c# help into console application

纵饮孤独 提交于 2019-12-12 04:38:03
问题 Background Information (based on my first question): i want to integrate in my "GUI.exe" (written in c#) a help function. Then when i want to start in my cmd -> "GUI.exe --h" the help function. Tried a stackoverflow- post: I have try to use this solution: Adding "--help" parameter to C# console application. static bool ShowHelpRequired(IEnumerable<string> args) { return args.Select(s => s.ToLowerInvariant()) .Intersect(new[] { "help", "/?", "--help", "-help", "-h" }).Any(); } Current problem:

multiple console windows for one Python script

前提是你 提交于 2019-12-12 04:26:06
问题 I've seen similar questions such as this one: keep multiple console windows open from batch. However, I have a different situation. I do not want to run a different script in a different console window. My idea is to have socket running as a server and accepting all connections. When a connection is accepted, a new console window is created, and all in-coming and out-going data is shown there. Is that even possible? 回答1: A process can only be attached to one console (i.e. instance of conhost

terminfo for windows console that is using read(stdin) for input

馋奶兔 提交于 2019-12-12 03:53:55
问题 I am writing an application that connect to a Linux box from Windows console over a custom socket, and I need to tell the Linux box what my console is capable of through TERM environment variable. For now I set TERM=dumb , but it is too limited. In particular I need Linux side to know that: I am reading input with standard reads from stdin, so no ESC, F1 and arrows are passed (but TAB is) Windows console has autowrap It is unable to process ANSI color sequences It is able to process carriage

Windows command line execute pdftk.exe with arguments length > 8192 characters

孤者浪人 提交于 2019-12-11 15:39:32
问题 I need to merge ~1000 pdf files. I call pdftk from my program for this purpose. However, it happens that input arguments exceeds maximum Windows command line character length of 8192 and i get error. I tried to store my input in txt file, but without success: pdftk < file.txt type file.txt | pdftk It looks like, that pdftk does not get input from redirection, pipe operators. I tested it on Windows 10. Does anyone know how it can be achieved? 来源: https://stackoverflow.com/questions/46727043

How do I read special characters (0x80 … 0x9F) from the Windows console in C#?

一世执手 提交于 2019-12-11 11:00:18
问题 I've finally solved the issue of writing special characters (0x80...0x9F) to the Windows console with the help of David: The output encoding has to be set to UTF-8. The font used by the console should be something like Consolas. Now I'd like to be able to read back text which contains special characters found in the 0x80-0x9F range (using the Windows 1252 encoding), such as the EURO sign (€): string text = System.Console.ReadLine (); returns null whenever I type one of the special characters.

How to replace \r\n (literal) with \n using FART.exe

前提是你 提交于 2019-12-11 10:25:48
问题 I have an xml format file for bulk loading in SQL Server 2008. I need to replace the instance of TERMINATOR="\r\n" with TERMINATOR="\n" . I'm trying to use the command line utility FART.exe . No matter how I try, I cannot seem to get the utility to recognize the characters. I have tried passing as combos of the find string and replace string: \r\n \n "\r\n" "\n" ""\r\n"" ""\n"" ^\r^\n ^\n TERMINATOR=""\r\n"" TERMINATOR=""\n"" TERMINATOR=""^\r^\n"" TERMINATOR=""^\n"" and many, many more

cmd console output to variable

北城以北 提交于 2019-12-11 09:35:50
问题 I have some tool which is outputs some data directly to console output. I want to save this output to some variable and then pass it somewhere else... Is it possible to do? Example: rem this outputs String1 values from myfile.txt GetString myfile.txt String1 rem I want this value for example in %p% variable, and then: call MyApp %p% 回答1: You can try this for /f %%a in ('GetString myfile.txt') do call MyApp %%a Although I'm not really sure what you mean about the String1 bit, if this isn't

How to disable user selection in Windows console

天大地大妈咪最大 提交于 2019-12-11 06:49:21
问题 I need to disable user mouse selection in the Windows console. Is it possible and how? I tried the function SetConsoleMode() to disable mouse input with it, but it did not work as I expected. Selecting was still possible. 回答1: The console's quick-edit mode allows the user to quickly select and copy text using the mouse, without having to first enter mark mode (i.e. Ctrl+M , or Edit -> Mark on the menu). It's usually convenient to enable quick-edit mode, but it does interfere with getting

How do i hide the console window for my app? [duplicate]

别等时光非礼了梦想. 提交于 2019-12-11 05:12:10
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How can I hide the console window in a PyQt app running on Windows? I've made a simple app that opens a QWebView but in addition to the app window Windows console window is opened to. What could be the reason for this? import sys import socket from PyQt4 import QtCore, QtGui from PyQt4.QtCore import * from PyQt4.QtGui import * from PyQt4.QtWebKit import QWebView class AppWindow(QtGui.QWidget): def __init__(self,