![]() ![]() It should look like the following (the "$" represents the prompt printed before where you type). (On older Windows, the equivalent command is "dir".) In this way, you can confirm that the command line is running in the correct directory. Within the terminal, type the "ls" command, which lists the names of the files and directories in the current folder. ![]() With the hello project opened, click the "Terminal" tab at the lower left, and P圜harm will create a command line terminal in the "hello" directory. Click on the hello folder and open it (do not click on the "hello.py" file in the folder, maddeningly that does not open the folder in the same way. Navigate to the "hello" folder unzipped above. How do you get a command prompt in a directory? There is a very easy way from within P圜harm: What regular users call a "folder" on the computer, programmers user the older term "directory", but it's the same thing - a directory has a name and holds a collection files and sub-directories. Windows will put up a dialog to choose where the files should go in that dialog, delete the "hello" off the end to avoid this nesting.Ī command line always runs in the context of a folder on the computer so the commands can have easy access to the files in that folder. Windows hello.zip issue: by default Windows expands hello.zip to create a "hello" folder with a second "hello" folder inside it, which is one too many folders. The examples below will use this hello folder as an example for various command. Expand it to get a "hello" folder that contains a "hello.py" file and some other files. zip file the folder where you'd like to keep your code. See the "Creating Command Line" at the end of this doc for how to get a command line without P圜harm.įor the examples bellow you can use our "hello" project. The command line is often called the "terminal" since that was the name for the screen and keyboard devices that were wired up to computers in the early days.īelow, we'll show how to get a terminal from within P圜harm which will be our common way to do it. The computer takes in what the user has typed, runs it, prints the resulting output to the screen, and then puts up a prompt again. In this example, shown in bold, the "date" command. The user types a command and hits the return (aka enter) key to run the command. The cursor is left blinking to the right of the prompt, waiting for the user to type something. With the command line, the computer types out a prompt, shown here as "$" although typically it is longer, showing things like the current folder. Here's a simple example of the command line, in this case running the command known as "date" which prints the current date and time (works on the Mac and Windows). That's a fantastic story, describing how billions of regular people to use computers to create dazzling results ever day.īut how does that work behind the scenes? The programmers's world putting this all together is driven by the command line. The user clicks and types, the computer reacts to follow their wishes. There are two views of the computer - in the user's view, one just picks up the computer to see text and image and icons.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |