Playing with the Raspberry Pi console
Instead of diving into GUI, I chose to work with the Raspberry Pi through its console. First, I wanted to check if a simple "Hello, World!" Python program (an interpretive language) would run. As we all know, simplicity can often carry its own weight of complications.
My favorite non-GUI text editor program is called vim. First, verify that vim is installed:
This returned a path telling me "vim.tiny" is installed. This isn't the full package version of vim I'm use to. When I try "vim" as a command, it tells me it's not found. However, vim.tiny works correctly, and executes the program. There is an alternative, called "vi", but it has less features than vim.tiny. Despite the similar-sounding names, I want to make sure you know that there's a key difference between these programs, as the former is much older than the latter.
Upon executing "vi", I immediately noticed that I couldn't navigate around with my favorite keyboard shortcuts. After a brief Google search, I discovered that this would put me back in familiar territory:
However, I don't want to use this older program because of the hassle of manually changing it back to default shortcuts. Instead, it makes sense to use vim.tiny. I close the program. I open up vim.tiny instead with a Python file name. Take note that you can name the file anything, as long as the extension makes sense.
Now I can go into "insert" mode and type print "Hello, World!"
To go into "insert" mode (so you can start typing in text):
Well, I couldn't even get that far. I quickly discovered that my keyboard was incorrectly mapped. For instance, I couldn't hit the quotation mark; instead, I saw a funny character. I exited the program by escaping out of insert mode and without saving the changes:
More Googling. I find out that the Raspberry Pi image is, by default, mapped to British keyboards. I followed a YouTube tutorial on how to change it to a US keyboard. (It took a bit of guesswork, as "backspace" wouldn't work properly, so I relied on "Delete" in order to make the changes.)
After the reboot, I resumed getting my program to function. As a recap:
Aha! The quote marks (and backspace!) work beautifully, so now I know the keyboard mapping was a success! To write the program to disk and exit, type:
Now, to see if the program runs correctly, return the following into the console:
The output was "Hello, World!" without any syntax errors. Voilà!
If anybody has questions, I'd be more than happy to write up a tutorial on vim and general commands for navigating the command line interface.