0% found this document useful (0 votes)
9 views

CMSC135 Lab Python Installation SetUpSoftware (2)

Uploaded by

aimashass7
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

CMSC135 Lab Python Installation SetUpSoftware (2)

Uploaded by

aimashass7
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CMSC 135 Introduction to Scripting

Lab Python Installation- Set up Software

Scope:
In this lab, students will install Python IDLE IDE.
Equipment/ Tool Needed:
This lab requires the use of the following:
 Laptop / Desktop
 Any version of Windows
 Any Web-Browser
Lab Outcomes:
Upon completion of this lab, students will be able to:
 Install and use IDLE and Python.
 Write Python Scripts
 Run Python Scripts
Steps:
The following steps will be completed and submitted via a Microsoft word file. Any other format
will not be accepted and will result in a zero grade:
1. Check System Requirements
a. Check the system requirement to know whether your computer supports IDLE.
2. Download and Install IDLE
a. Open browser and go to https://www.python.org/downloads/. Choose the version
of Python you want to install (version 3.8.3 for this lab) and make sure to check if
it fits the architecture of your system (32-bit or 64-bit). Save the Python installer
and run it. The installation process will then begin. Default options are usually
just fine. Nonetheless, you can also decide to check the box “Add Python 3.8 to
the PATH”. Click on “Install Now” and click through the prompts. This installs
IDLE.
b. At the end of the successful installation of Python and before you close the
installation wizard, you might see that the installer is asking you to “Disable path
length limit”. It is recommended to select that option and thereby removing
the path length limit. It is important because if Python was installed in a directory
with a path length greater than 260 characters, adding it to the path could fail.
So, do not worry about that action and proceed to it. You can then close the
installation wizard. You have successfully installed Python!
3. Create and Run a New Python Source File
a. Type “python” in your Windows search bar to open and run Python in the
command line. However, for this tutorial purpose, we will work with IDLE. Type
“IDLE” in your Windows search bar to open and run IDLE. IDLE has a Python
shell window, which gives you access to the Python interactive mode. It also has a
file editor that lets you create and edit existing Python source files. Figure below
shows the main window to IDLE, and what is seen right now is called the
"Interpreter" (or "Shell") window. The Interpreter allows users to enter
commands directly into Python, and as soon as we enter in a command, Python
will execute it and display its result.

The interpreter window includes both our commands and the system's responses.
The '>>>' signs act as a prompt to read in a new command. Also, we notice that as
we enter in commands, Python will give us its output immediately. Make sure you
respect the Python syntax and indentation rules to avoid errors. Figure below
shows inputs from the user and the resulting outputs (in blue color).

When we close the Python Shell, everything is deleted. Nothing will appear on
the screen when we restart it. That means that when you are using the Python
Shell, all your work is not saved. You need to save it in a file to avoid losing all
the work you did and retyping the whole thing over again. IDLE offers a way to
save a prepared file, with just our commands, and to be able to save that file as a
document.
b. To save your Python code in a file, in the Python Shell, go to File  New File or
press Ctrl + N, which will open a text editor window named “untitled.” In this text
editor window, you can now write your code as shown in figure below.

c. Once you finish writing your code, you will need to run it. To do that, you will
first need to save your file in your file directory. To do that, in the IDLE file
editor, click on Run  Run module or press F5 as shown in figure below.

d. You can also save your code by going to File  Save or Ctrl + S. You will be
asked to save the file as shown in figure below. Click on OK and you will be
redirected to your file directory. Choose where you want to save your file and
give a name to your file (“myFirstPythonProgram”). Do make sure you are saving
the file as a “Python files” type. When you finish, click on Save. Your file will be
saved as a Python File with the “.py” extension in the location you chose in your
file directory. This is called a” Python script” or “Python source file.”
e. For more information on the IDLE Menu bar, the Python library offers more
details in the following link: https://docs.python.org/3/library/idle.html

Evaluation: 100 Points. All requirements are graded. Use the requirements listed above as your
checklist to ensure you have completed all the requirements.

Grading Criteria Points


1. File format requirements (Word document with title page and label for 5
each screenshot)
2. Screen shot of IDLE Running. Screenshot while software is 20
downloading.
3. Write code in step 3a in shell and submit screen shot 15
4. Write code in step 3c in new file named myfirstPythonProgram.py 15
5. Screen shot of myfirstPythonProgram file running in word and 15
myfirstPythonProgram.py file.
6. Quality of detailed steps and screenshots as per requirements listed 10
above.
7. Correct spelling & grammar. 5
8. Font consistency 5
9. Correct citations in MLA or APA format. All sources will also include 5
links.
10. Submitted the deliverables as per the due dates specified in the course 5
schedule.

Questions:
It is up to each student to clarify any part of these guidelines, which may be unclear immediately
after this lab has been assigned.

You might also like