The Terminal can help you configure your Mac exactly how you want it and provide access to features that just don't have any graphical interface to change. There are many options that are perfectly safe to use but to avoid overwhelming the user, they're hidden away, only to be found by power users wanting to make the change. Even without becoming an expert in Apple's Terminal app, you can use simple commands to achieve things your Mac won't let you do in any other way. If you're just getting used to Terminal. The game will launch. Move the pieces with your arrow keys, and drop them with Space. It’s clumsy, but it’s a version of Tetris that came with your Mac. You can launch other games from Emacs, too. Repeat the steps above, then type these words instead of tetris to launch alternative games: pong: the classic line and pixel tennis game.
As a budding developer, you should constantly look for tips, tricks, and resources to make programming more efficient. Prepare to add another nifty tool to your bucket today – the terminal and command line. The command line can seem intimidating when you first access it, but once you start using it regularly, you’ll quickly start to learn how to utilize this powerful tool.
The command-line is used to enter commands to the operating system, instead of graphical user interface (GUI). This is because command-line is much more flexible than graphical interface, which is what makes it so handy to developers.
Access That Terminal
The terminal is the actual interface to the console that you can type and execute text based commands.
To launch the terminal on a mac:
Open Finder > Applications > Utilities > Terminal
A Terminal displays a command prompt ending with “$” sign, in the form of:
“ComputerName:CurrentDirectoryUsername$”
You can enter commands after the command prompt. Keep in mind that you cannot access source code through a terminal. The terminal is used to execute commands that allow you to do a certain task.
Now That You’re In, Let’s Use the Command Line
The command line is the actual line in a console where you type your command. Aside from its development-related purposes, the command line is an excellent tool for automating actions, scripting, and a host of other things that are typically faster than doing them in Finder.
All commands have three parts: the utility, the flags, and the arguments. The utility is always first in the command, with the flag and argument following depending on their rules. Here is an example of a command that you would type into the command line:
When you open the terminal, it typically opens to the home directory of your computer. Using the utility “cd” or “Change directory” you can navigate to a different folder or “directory” in your computer. Here is how to use the cd utility to navigate to the documents directory of your computer.
From your terminal window type this command:
The $ is a symbol commonly used to indicate the command line. It simply means that the rest of the line is a command, rather than a sentence.
`cd documents`
This command would change from your current directory to the “Documents” directory. You can tell this has worked because the prompt before the “:” should now read
`computername: Documents username:`
Now that you’re in the Documents directory of your computer you can use the list or “ls” utility to show you all the documents you have in that folder:
`ls`
This should list out all of the documents you have in that current directory.
From your terminal window type this command:
In the example commands we show “cd” and “ls” are the utilities. Utilities are also sometimes known as commands all on their own, because they indicate the general idea of what you want. Most of the time, you can simply run a utility all by itself, without any flags or arguments. Most commands only have one utility.
The flag that alters how the utility operates. Flags are like options or preferences: the utility will usually work perfectly well with the defaults, but sometimes, you want to modify how it works slightly. Flags always start with either one or two dashes (-), and they usually come between the utility and the arguments.
In the example we give the “cd” utility and argument of “Documents/” to tell the command line which directory we want to change to. Arguments are used when the utility needs to know exactly what you want for a certain action, and there is no clear default setting.
To submit a command to the computer simply press enter.
Learning commands can seem overwhelming, but the more you practice the better you will become. Learn more about becoming a Software Engineer with our immersive bootcamp.
Installing PyGame on a Mac OS
This blog will tell you how you can install PyGame on a Mac OS
Sep 21, 2018 By Team YoungWonks
How To Get Games On Terminal Mac Mojave
In this blog, we shall look at the procedure to install PyGame on a Mac OS (Operating System); we also have a blog about installing PyGame on a Windows PC. Now PyGame is cross-platform set of modules in the Python programming language. These modules are designed for writing video games. Thus PyGame includes computer graphics and sound libraries that have been created to be used with the Python programming language. W
Now how do we do install PyGame on a Mac? Let us start by looking at how one can install Python on a Mac.
The video below tells you how to do so...
How To Get Mac Address
Now that we have installed Python on the Mac, we can go on to install PyGame.
Installation of PyGame on Mac:
- Start by opening Spotlight search bar on your Mac. You can do this by taking your cursor to the top right corner of your desktop and clicking on the magnifying glass icon.
- Once you have opened the Spotlight search bar, type terminal in the bar to open terminal.
- Now type pip3.
- If you see a bunch of general options on the screen, it means that pip is already installed on your MacBook.
- Now type pip3 install pygame as shown in this (below) image.
- The installation will start at this point and you need to wait till the PyGame installation is done. You’ll know it’s done when you see a message (as shown below) saying successfully installed pygame.
- To test if PyGame has been installed on your Mac, open IDLE by typing IDLE in your Spotlight search bar.
- Then type import pygame as shown in the image.
- If you do not see any error, it means that PyGame has been successfully installed on your Mac.
Shared below is a video explaining how one can install PyGame on one's Mac:
This blog is presented to you by YoungWonks. The leading coding program for kids and teens.
YoungWonks offers instructor led one-on-one online classes and in-person classes with 4:1 student teacher ratio.Sign up for a free trial class by filling out the form below:
