windows-console

unable to print euro symbol in a “C” program

a 夏天 提交于 2021-02-05 05:38:07
问题 I am unable to print the euro symbol. The program I am using is below. I have set the character set to codepage 1250 which has 0x80 standing for the euro symbol. Program ======= #include <stdio.h> #include <locale.h> int main() { printf("Current locale is: %s\n", setlocale (LC_ALL, ".1250")); printf("Euro character: %c\n", 0x80); getchar(); return 0; } Output ====== Current locale is: English_India.1250 Euro character: ? Other details ============= OS: Windows Vista Compiler: vc++ 2008

unable to print euro symbol in a “C” program

怎甘沉沦 提交于 2021-02-05 05:38:07
问题 I am unable to print the euro symbol. The program I am using is below. I have set the character set to codepage 1250 which has 0x80 standing for the euro symbol. Program ======= #include <stdio.h> #include <locale.h> int main() { printf("Current locale is: %s\n", setlocale (LC_ALL, ".1250")); printf("Euro character: %c\n", 0x80); getchar(); return 0; } Output ====== Current locale is: English_India.1250 Euro character: ? Other details ============= OS: Windows Vista Compiler: vc++ 2008

OCaml read pressed key without graphical window

喜欢而已 提交于 2021-01-28 04:05:50
问题 Edit. I am working in a Windows environment. I want to write a simple game in console output with OCaml. I need to be able to use a 'read_key' function. But : The graphics module throws an error : Exception: Graphics.Graphic_failure "graphic screen not opened". But I do not want to open the graphic window. The function read_line forces the user to press "return" after every key press... 回答1: It is not possible to implement such function using pure OCaml. You will need to call to platform

Windows 'dir' command: sort files by date when '/s' is specified

与世无争的帅哥 提交于 2021-01-27 18:53:31
问题 Goal: I want to copy the latest file with a certain extension from a "source directory" to a "destination directory" using a batch file. The latest file may be under several sub-directories within the source directory. This question/answer is exactly what I want, however it does not seem to sort when the /s option is specified (as this comment would suggest): FOR /F "delims=|" %%I IN ('DIR "K:\path\tp\source\dir\*.ext" /B /S /O:D') DO SET NewestFile=%%I copy "%NewestFile%" "C:\path\to

Why can't I redirect output from WriteConsole?

我是研究僧i 提交于 2021-01-21 09:03:52
问题 In the following program I print to the console using two different functions #include <windows.h> int main() { HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); DWORD byteswritten; WriteConsole(h, "WriteConsole", 12, &byteswritten, NULL); WriteFile(h, "WriteFile", 9, &byteswritten, NULL); } If when I execute this program and redirect it's output using a > out.txt or a 1> out.txt nothing gets printed to the console (as expected) but the contents of out.txt are only WriteFile What is different

How to Enable Scrolling for Python Console Application

☆樱花仙子☆ 提交于 2020-12-07 04:47:58
问题 I have a Python (2.7) console application that I have written on Windows (8.1). I have used argparse.ArgumentParser() for handling the parameters when executing the program. The application has quite a few parameters, so when the --help parameter is used the documentation greatly exceeds the size of the console window. Even with the console window maximized. Which is fine, but the issue I'm encountering is that the user is unable to scroll up to view the rest of the help documentation. I have

How to Enable Scrolling for Python Console Application

最后都变了- 提交于 2020-12-07 04:47:07
问题 I have a Python (2.7) console application that I have written on Windows (8.1). I have used argparse.ArgumentParser() for handling the parameters when executing the program. The application has quite a few parameters, so when the --help parameter is used the documentation greatly exceeds the size of the console window. Even with the console window maximized. Which is fine, but the issue I'm encountering is that the user is unable to scroll up to view the rest of the help documentation. I have

From Python run WinSCP commands in console

為{幸葍}努か 提交于 2020-12-04 05:32:36
问题 I have to run a few commands of WinSCP from a Python class using subprocess. The goal is to connect a local Windows machine and a Windows server with no FTP installed and download some files. This is what I tried python proc = subprocess.Popen(['WinSCP.exe', '/console', '/WAIT', user:password@ip:folder , '/WAIT','get' ,'*.txt'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) With this I get it to open the WinSCP console and connect to the server, but it doesn't execute the get

From Python run WinSCP commands in console

♀尐吖头ヾ 提交于 2020-12-04 05:29:31
问题 I have to run a few commands of WinSCP from a Python class using subprocess. The goal is to connect a local Windows machine and a Windows server with no FTP installed and download some files. This is what I tried python proc = subprocess.Popen(['WinSCP.exe', '/console', '/WAIT', user:password@ip:folder , '/WAIT','get' ,'*.txt'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) With this I get it to open the WinSCP console and connect to the server, but it doesn't execute the get

From Python run WinSCP commands in console

大兔子大兔子 提交于 2020-12-04 05:28:36
问题 I have to run a few commands of WinSCP from a Python class using subprocess. The goal is to connect a local Windows machine and a Windows server with no FTP installed and download some files. This is what I tried python proc = subprocess.Popen(['WinSCP.exe', '/console', '/WAIT', user:password@ip:folder , '/WAIT','get' ,'*.txt'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) With this I get it to open the WinSCP console and connect to the server, but it doesn't execute the get