![]() To leave the python interpreter type the exit command exit() and hit the Enter key.Īny functions or variables created in the python interpreter are erased when the exit() command is run. From here you won't be able to run any other command. If the text cursor is on a line beginning with >, the command line window has an active python interpreter open. Try typing the following into the interpreter: The second bash will keep the interactive terminal session open, irrespective of the CMD command in the Dockerfile the image has been created with, since the CMD command is overwritten by the bash - c command above. After typing a line of code, hitting the Enter key will tell the python interpreter to run the instruction. The > indicates where to enter python code. There are a few differences with Python 2.x, but everything in this lab should work well in both versions. Try loading just python if you don't have version 3. On your own computer, you may not have version 3.4. Note: The version of Python being used in this lab is Python 3.4. Type "help", "copyright", "credits" or "license" for more information. You should see something similar to the following: The "3" indicates the version of python we will be using in this lab. ![]() On the command line type python3 and hit the return key. The next step is to open the Python "interpreter". ![]() If you are unable to get python to work from the command line (as explained below) here is a link that will help you get things set up. Note: Python may not be set up properly on windows. Do a search for for cmd.exe on your computer. Windows allows you to perform many common actions, like creating or navigating folders and launching applications, from what is called the CMD command prompt. On Mac and Linux, the Terminal application can be accessed from the Applications folder or using a quick-search function. From here, many common actions, like creating or navigating folders and launching applications, can be performed via the command line. The Terminal window is like a text-based version of your computer. We've done our best to provide information for all major operating systems (although it's easier on some systems than on others). This section provides information regarding how to run python and use a command prompt on your computer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |