Printing Unicode in eclipse Pydev console and in Idle

For eclipse unicode console support: Add -Dfile.encoding=UTF-8 to eclipse.ini which is in the eclipse install directory. In eclipse – Run\Run Configurations\Python Run\configuration\Common\ make sure UTF-8 is selected In eclipse – Window\Preferences\General\Workspace\Text file encoding\ making sure UTF-8 is selected In [python install path]\Lib\site.py – change from encoding = “ascii” to encoding = “utf-8” Make sure you’re … Read more

Drawing in a Win32 Console on C++?

Yes, it is possible. Get the HWND of the console window using GetConsoleWindow and then draw in it. #define _WIN32_WINNT 0x601 #include <windows.h> #include <stdio.h> int main() { // Get window handle to console, and device context HWND console_handle = GetConsoleWindow(); HDC device_context = GetDC(console_handle); //Here’s a 5 pixels wide RED line [from initial 0,0] … Read more

Changing font in a Console window in C#

There’s two problems with the way you’ve defined those API calls. First, the documentation for SetCurrentConsoleFontEx says: lpConsoleCurrentFontEx A pointer to a CONSOLE_FONT_INFOEX structure that contains the font information. So the third parameter needs to be passed by reference: [DllImport(“kernel32.dll”, SetLastError = true)] static extern bool SetCurrentConsoleFontEx( IntPtr consoleOutput, bool maximumWindow, ref CONSOLE_FONT_INFO_EX consoleCurrentFontEx); and … Read more

What will give me something like ruby readline with a default value?

What you are asking is possible with Readline. There’s a callback where you can get control after the prompt is displayed and insert some text into the read buffer. This worked for me: Readline.pre_input_hook = -> do Readline.insert_text “hello.txt” Readline.redisplay # Remove the hook right away. Readline.pre_input_hook = nil end input = Readline.readline(“Filename: “, false) … Read more

How to align String on console output

You can use format() to format your output according to your need.. for(int i=1; i<13; i++){ for(int j=1; j<13; j++){ System.out.format(“%5d”, i * j); } System.out.println(); // To move to the next line. } Or, you can also use: – System.out.print(String.format(“%5d”, i * j)); in place of System.out.format.. Here’s is the explanation of how %5d … Read more

Advanced Console IO in .NET

Console.SetCursorPosition, Console.BackgroundColor, Console.ForegroundColor, and Console.ResetColor. Note these were added to the .NET Framework in version 2.0. Prior to that you would have needed PInvoke.