console

dollar-terminated strings

In my assembly language class, our first assignment was to write a program to print out a simple dollar-terminated string in DOS. It looked something like this: BITS 32 global _main section .data msg db "Hello, world!", 13, 10, ’$’ section .text _main: mov ah, 9 mov edx, msg int 21h ret As I understand it, the $ sign serves...

How can I get a Windows console to stay open?

I'm trying to run a script from the Windows XP console. (In case it's relevant, it's a file of WinSCP commands.) When I type in the command to run the script, another console window pops up for about half a second, then it disappears. The script isn't working. The error message may be in the console window that popped up. How can I get ...

Can I use IPython in an embedded interactive Python console?

I use the following snippet to drop into a Python shell mid-program. This works fine, but I only get the standard console. Is there a way to do the same but using the IPython shell? import code class EmbeddedConsole(code.InteractiveConsole): def start(self): try: self.interact("Debug console starting...") ...

F# how to abstract Console.ReadLine() as string seq

Hi, I want to write a function to abstract Console.ReadLine() into a string seq the seq should break when line = null ConsoleLines(): unit -> string seq To be used like this: for line in ConsoleLines() do DoSomething line How do you write this function? Thanks ...

In Ubuntu Intrepid, what keypress will take me to tty13?

Trying out Ubuntu Intrepid, I have discovered that RightAlt+F1 doesn't take me to tty13. I've exhaustively tried every option presented to me in "dpkg-reconfigure console-setup", the best I've been able to manage thus far has been to have both Alt keys behave the same (LeftAlt+F1 and RightAlt+F1 both going to tty1). Please note that usi...

Selecting a database in mysql with spaces in its name

I want to select my particular database in mysql console, but the problem is that my database name has a space in between and mysql ignores the part after the space. For instance, when i give the command: use 'student registration' I get the message: cannot find database 'student' ...

python 3.0, how to make print() output unicode?

I'm working in WinXP 5.1.2600, writing a Python application involving Chinese pinyin, which has involved me in endless Unicode problems. Switching to Python 3.0 has solved many of them. But the print() function for console output is not Unicode-aware for some odd reason. Here's a teeny program. print('sys.stdout encoding is "' + sys.std...

Can a Win32 console application detect if it has been run from the explorer or not?

I have to create a console application which needs certain parameters. If they are missing or wrong I print out an error message. Now the problem: If someone starts the program from the explorer by double-clicking the console window disappears immediately. (But the application is not entirely useless from the explorer, you could drag fi...

C# console program - stop STDIN from going to STDOUT

I'm writing a simple console app in C#, .NET 2.0. It starts new threads using a threading timer, while it interprets commands on the main thread. I currently take three commands: P - Pause C - Continue Q - Quit This functionality works quite well, but unfortunately when I type P, C, or Q (or any other character for that matter), the c...

How to clear python interpreter console?

Like most Python developers, I typically keep a console window open with the Python interpreter running to test commands, dir() stuff, help() stuff, etc. Like any console, after a while the visible backlog of past commands and prints gets to be cluttered, and sometimes confusing when re-running the same command several times. I'm wonde...

Console menu updating OpenGL window

I am making an application that does some custom image processing. The program will be driven by a simple menu in the console. The user will input the filename of an image, and that image will be displayed using openGL in a window. When the user selects some processing to be done to the image, the processing is done, and the openGL windo...

python console intrupt? and cross platform threads

I want my app to loop in python but have a way to quit. Is there a way to get input from the console, scan it for letter q and quick when my app is ready to quit? in C i would just create a pthread that waits for cin, scans, locks a global quit var, change, unlock and exit the thread allowing my app to quit when its done dumping a file o...

Override Console Close

I know the GUI has private void Form1_Closing(object sender, System.ComponentModel.EventArgs e) { //do stuff } But how can i do the same thing in a console application? C#/.NET3.5 ...

How to use SetConsoleHandler() to block exit calls

Ok so i know that i have to use setconsolehandler() if i want to manage console closing events. So i have a little of an understanding, but i don't know how to block the CTRL_CLOSE_EVENT, ive tried returning false/true if it catches that event, but no success Here is what i have so far (thank you Anton Gogolev!) [DllImport("Kernel32...

Flex Builder, debugging - auto log console output

Can I make Flex Builder store all the output in the console window to a log file ? ...

Command-line dialog tool for Windows

I need a dialog tool similar to cdialog (or whiptail), but one that will work on Windows. I have MinGW and compiling something from source is no problem, but both cdialog and whiptail, the only ones that I know of, contain code that is UNIX-specific, and so they will not compile on Windows. Are there any alternatives that I can use? I...

How to get console window width in python

Is there a way in python to programmatically determine the width of the console? I mean the number of characters that fits in one line without wrapping, not the pixel width of the window. Edit Looking for a solution that works on Linux ...

checkout svn+ssh with loginname

Hi I want to checkout something out of an repository .. but wenn i type : svn co svn+ssh://URL i get asked for the password.I suppose he uses the username from my console which aren't the same. So how can i checkout something with svn+ssh with a different loginname ? ...

Elevating privileges for UAC using manifest open new console window

I'm writing a console tool. Without privileges elevating for UAC support (manifest file), calling this tool from command prompt (cmd.exe) or console file manager (like far.exe) opens it in the same window, writes its output to the same window, etc. But now, when manifest file was added, a new console windows is created for tool after UA...

how to output to console in C++/Windows

When using iostream in C++ on Linux, it displays the program output in the terminal, but in Windows, it just saves the output to a stdout.txt file. How can I, in Windows, make the output appear in the console? ...