0% found this document useful (0 votes)
23 views4 pages

Python IDLE Installation Lab Guide

Uploaded by

aimashass7
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views4 pages

Python IDLE Installation Lab Guide

Uploaded by

aimashass7
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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 [Link] 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: [Link]

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 [Link] 15
5. Screen shot of myfirstPythonProgram file running in word and 15
[Link] 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.

Common questions

Powered by AI

Challenges include potential execution failures if the path length limit is not disabled, causing issues with directories exceeding 260 characters. Users might also lose unsaved work, as the Python Shell does not save inputs upon closure. Mitigation involves diligently following setup guidelines, ensuring the path length limit is disabled, consistently saving scripts in progress to prevent loss, and organizing project files logically in the directory structure, following the correct naming conventions and file extensions .

IDLE provides an interactive environment for writing and running Python scripts. To start, open IDLE from your search bar, which gives access to the Python shell for entering commands directly. To ensure your work is saved, you must open a new file via File -> New File or Ctrl + N in the shell, which opens a text editor for your code. After writing your script, you save it via File -> Save or Ctrl + S, ensuring it is saved with a '.py' extension. To execute the script, you can run it using Run -> Run Module or F5 in the IDLE file editor .

To install Python IDLE on a Windows system, you must first verify that your computer supports IDLE by checking system requirements. You then visit the official Python website (https://www.python.org/downloads/) to download the appropriate version of Python (3.8.3 for this lab), ensuring it matches your system architecture (32-bit or 64-bit). Run the installer using default options and ensure the option 'Add Python 3.8 to the PATH' is selected. Upon successful installation, you are recommended to disable the path length limit to prevent errors in adding directories with paths longer than 260 characters to the PATH, ensuring seamless execution of Python commands .

The Python Interpreter in IDLE is a tool that allows users to execute commands immediately, providing real-time feedback on their code. It is significant for the development process as it helps test small code snippets quickly without needing to write and save a full script. Users enter commands at the prompt ('>>>'), and the interpreter executes them immediately, allowing for interactive testing and debugging of Python syntax and logic on-the-fly .

Submission guidelines, such as requiring Word format with specific labels and screenshots, ensure students comprehend and follow detailed instructions, thereby reinforcing their understanding and execution of practical scripting tasks. This emphasis on documentary precision not only assesses technical competence but also encourages students to develop organizational skills, attention to detail, and an appreciation for consistent documentation practices, which are vital in professional settings .

Emphasizing correct spelling, grammar, and citation cultivates professionalism and attention to detail among computer science students. It reinforces the importance of clear communication, essential when documenting code or collaborating in technical fields. Accurate citations also uphold academic honesty and demonstrate the ability to engage with and credit existing work, fostering skills that are crucial in both academic research and software development industries .

The documentation link to the IDLE Menu bar enhances educational outcomes by providing students direct access to comprehensive resources, which demystify the full capabilities of IDLE. This empowers students to explore advanced features independently, promoting self-directed learning, and reinforcing understanding of Python's functionality and environment beyond basic lab instructions. It encourages ongoing learning and adaptation to new tools and techniques within the Python ecosystem .

Not saving work promptly in IDLE risks data loss because any unsaved commands in the Python Shell are cleared when the session is closed. To mitigate this, users should frequently save scripts using the text editor in IDLE. Implementing best practices like maintaining regular save habits, using version control systems for tracking changes, and backing up work in cloud storage can ensure data persistence and retrieval in case of unexpected shutdowns or errors .

The requirement to submit assignments in a specific file format, like a Word document, streamlines the grading process, allowing instructors to assess work systematically and consistently. It ensures all relevant data such as screenshots and written responses are clearly presented, making it easier to evaluate technical proficiency and adherence to guidelines. This format requirement encourages students to learn and utilize applicable software tools, fostering technical literacy and organizational skills vital for professional documentation tasks .

Adhering to Python syntax and indentation rules is critical because Python is a language where indentation signifies a block of code. In IDLE and Python scripting, incorrect syntax or indentation can lead to syntax errors or logic errors, disrupting execution flow and producing incorrect results. Correct indentation ensures that scripts are executable and logic is coherently structured, preventing potential runtime errors and ensuring compatibility with Python's execution model .

You might also like