Week4_CM_MDL_CS328
Week4_CM_MDL_CS328
Learning Outcomes:
After completing this course you are expected to demonstrate the following:
1. Introduce Python 3 IDLE environment
2. Install Pydroid for android mobile phones.
A. Engage
B. Explain
IDEs vary greatly in the level and kind of intelligence they provide, which is why so many IDEs exist.
You may find the level of help obtained from one IDE to be insufficient to your needs, but another IDE
hovers over you like a mother hehen.
n. Every developer has different needs and, therefore, different IDE
requirements. The point is to obtain an IDE that helps you write clean, efficient code quickly and
easily.
The best IDEs double as training tools. Given enough features, an IDE can help you explore code
written by true experts. Tracing through applications is a time
time-honored
honored method of learning new skills
and honing the skills you already possess. A seemingly small advance in knowledge can often become
a huge savings in time later. When loo
looking
king for an IDE, don’t just look at debugging features as a means
to remove errors — see them also as a means to learn new things about Python.
C. Explore
Video Title:
Python - A first introduction to the Python IDLE Interface
YouTube Link:
https://www.youtube.com/watch?v=bOvqYw1SZJg
Prepared and Validated By: Mr. Darwin Dela Cruz | Dean Manuel Luis C. Delos Santos, MSCS Page 1 of 10
ASIAN INSTITUTE OF COMPUTER STUDIES
Bachelor of Science in Computer Science
Course Modules
CS328 - Programming Languages
3rd Year – 2nd Semester
D. Elaborate
Python IDLE
IDLE is an integrated development environment (an application like a word processor which helps
developers to write programs) for Python. IDLE is the Python IDE which comes with Python, built with
the tkinter GUI toolkit. It has two modes Interactive and Development.
IDLE features:
Let us assume that we've already installed Python (here we installed Python 3.2 on a standard pc with
windows 7 OS). Click on start button and find Python 3.2 tab in installed programs.
Figure 4.1
Now clicking on Python 3.2 tab you can see the Python program development tool named IDLE (Python
GUI).
Figure 4.2
To start IDLE click on IDLE (Python GUI) icon, you will see a new window opens up and the cursor is
waiting beside '>>>' sign which is called command prompt.
Prepared and Validated By: Mr. Darwin Dela Cruz | Dean Manuel Luis C. Delos Santos, MSCS Page 2 of 10
ASIAN INSTITUTE OF COMPUTER STUDIES
Bachelor of Science in Computer Science
Course Modules
CS328 - Programming Languages
3rd Year – 2nd Semester
Figure 4.3
This mode is called interactive mode as you can interact with IDLE directly, you type something (single
unit in a programming language) and press enter key Python will execute it, but you can not execute
your entire program here. At the command prompt type copyright and press enter key Python executes
the copyright information.
Figure 4.4
Now Python is ready to read new command. Let's execute the following commands one by one.
The first command is correct and but the second one has a syntax error, here is the response from
Python.
Figure 4.5
Prepared and Validated By: Mr. Darwin Dela Cruz | Dean Manuel Luis C. Delos Santos, MSCS Page 3 of 10
ASIAN INSTITUTE OF COMPUTER STUDIES
Bachelor of Science in Computer Science
Course Modules
CS328 - Programming Languages
3rd Year – 2nd Semester
File Menu
Edit Menu.
Undo : Undo last change to current window (max 1000 changes). Shortcut key : Ctrl+Z
Redo : Redo last undone change to current window. Shortcut key : Ctrl+shift+Z
Cut : Copy selection into system-wide clipboard; then delete the selection. Shortcut key : Ctrl+X
Copy : Copy selection into the system-wide clipboard. Shortcut key : Ctrl+C
Paste : Insert system-wide clipboard into the window. Shortcut key : Ctrl+V
Select All: All Select the entire contents of the edit buffer. Shortcut key : Ctrl+A
Find... : Open a search dialog box with many options. Shortcut key : Ctrl+F
Find again : Repeat last search. Shortcut key : Ctrl+G
Find selection : Search for the string in the selection. Shortcut key : Ctrl+F3
Find in Files... : Open a search dialog box for searching files. Shortcut key : Alt+F3
Replace...: Open a search-and-replace dialog box. Shortcut key : Ctrl+H
Go to line : Ask for a line number and show that line. Shortcut key : Alt+G
Expand word : Expand the word you have typed to match another word in the same buffer;
repeat to get a different expansion
Show call tip. Shortcut key : Ctrl+backslash
Show surrounding parentheses. Shortcut key : Ctrl+0
Show completions. Shortcut key : Ctrl+space
Shell Menu
Debug Menu
Go to file/line look around the insert point for a filename and line number, open the file, and
show the line.
Debugger
Stack viewer shows the stack traceback of the last exception
Auto open stack viewer.
Options Menu
Configure IDLE
Prepared and Validated By: Mr. Darwin Dela Cruz | Dean Manuel Luis C. Delos Santos, MSCS Page 4 of 10
ASIAN INSTITUTE OF COMPUTER STUDIES
Bachelor of Science in Computer Science
Course Modules
CS328 - Programming Languages
3rd Year – 2nd Semester
Windows Menu
Zoom height. Shortcut key : Alt+2
Python shell.
Help Menu
About IDLE.
IDLE Help.
Python Documents. Shortcut key : F1
Figure 4.6
Clicking on "New window" under file menu a new window will come. Type print "Hello World"
in the new window.
Figure 4.7
Let's save (Save command is located under the File menu) the file now. We save the program as
helloworld.py under E:/python-programs folder.
Figure 4.8
Prepared and Validated By: Mr. Darwin Dela Cruz | Dean Manuel Luis C. Delos Santos, MSCS Page 5 of 10
ASIAN INSTITUTE OF COMPUTER STUDIES
Bachelor of Science in Computer Science
Course Modules
CS328 - Programming Languages
3rd Year – 2nd Semester
Figure 4.9
Now click on Run Module or press F5 as a shortcut key to see the result.
Figure 4.10
Figure 4.11
Prepared and Validated By: Mr. Darwin Dela Cruz | Dean Manuel Luis C. Delos Santos, MSCS Page 6 of 10
ASIAN INSTITUTE OF COMPUTER STUDIES
Bachelor of Science in Computer Science
Course Modules
CS328 - Programming Languages
3rd Year – 2nd Semester
Here is the screen shot of Python command line interface. To return type exit() or Ctrl+Z plus
Enter key.
Figure 4.12
E. Evaluate
ASSESSMENT:
Instruction: Answer the questionsbelow. Write your answer in the space provided for 2 points
each.
MATCHING TYPE: Match Column A with Column B.
Prepared and Validated By: Mr. Darwin Dela Cruz | Dean Manuel Luis C. Delos Santos, MSCS Page 7 of 10
ASIAN INSTITUTE OF COMPUTER STUDIES
Bachelor of Science in Computer Science
Course Modules
CS328 - Programming Languages
3rd Year – 2nd Semester
Figure 4.13
Figure 4.14
Prepared and Validated By: Mr. Darwin Dela Cruz | Dean Manuel Luis C. Delos Santos, MSCS Page 8 of 10
ASIAN INSTITUTE OF COMPUTER STUDIES
Bachelor of Science in Computer Science
Course Modules
CS328 - Programming Languages
3rd Year – 2nd Semester
Figure 4.15
However, if you like to create a new project folder, repeat the process above, but tap on the NEW
FOLDER option instead of SELECT FOLDER
FOLDER.. Give your new folder a preferred name and tap CREATE to
save the folder. Next, click on the SELECT FOLDER option. Name your new file and
a tap SAVE to save your
new file in the folder you just created.
Note that the newly created file doesn't need a file extension if it's a Python file. But in case you need to
use another language file to serve your project, ensure that you include the fil
file extension that applies to
that language while saving such a file. For instance, a CSS file should be saved as Name.css,
replacing Name with your preferred file name.
Figure 4.16
Prepared and Validated By: Mr. Darwin Dela Cruz | Dean Manuel Luis C. Delos Santos, MSCS Page 9 of 10
ASIAN INSTITUTE OF COMPUTER STUDIES
Bachelor of Science in Computer Science
Course Modules
CS328 - Programming Languages
3rd Year – 2nd Semester
To update the changes you've made to an existing file, tap the folder sign at the top-right corner of the
editor, and select Save.
To create a new file entirely, tap the folder sign. Select New and follow the steps highlighted earlier to
save your file in a folder. If you want your new file to be in the same directory as the existing one,
ensure that you select the same folder that contains the existing one.
References:
https://www.ics.uci.edu/~pattis/common/handouts/pythoneclipsejava/python.html
2. Python IDLE –
https://www.w3resource.com/python/python-ide.php
https://www.makeuseof.com/install-pydroid-android/
Facilitated By:
Name :
MS Teams Account (email) :
Smart Phone Number :
Prepared and Validated By: Mr. Darwin Dela Cruz | Dean Manuel Luis C. Delos Santos, MSCS Page 10 of 10