1.5 KiB
2 - Console In and Out
What is the console?
The answer to this question is "it's a place to send and receive text to and from your program". For any programs that you run from the command line (Command Prompt in Windows, Terminal in most Linux Distributions), the console is the window you see. This window can produce text from your program (Console/Standard Out) or can accept text from the keyboard (Console/Standard In). All programs technically, in some way shape or form, have a console, even if it's not run directly from Command Prompt/Terminal, but we often don't see or interact with it, because we spend most of our time interacting with our programs visually, rather than with text.
Why is this relevant to Robot Programming, am I going to be typing commands to my robot?
The console out piece is important to robot programming because you can use it as a mechanism to identify where your robot program "is" when it's running. You can use print() to send messages to the Driver's Station computer that you'll be able to see and use to identify issues. For example, you could place several print() statements throughout your code to identify when a "step" completes, when your robot code crashes, you can just look for which print() statement recently displayed in the console, and know roughly where in your code there may be an issue.
You don't really use Console In in Robot Programming, but they go hand in hand, and its good to know how to do both if you want to continue to learn to program in Python.