In-class activity: Run a Python program in IDLE on a Dickinson Virtual Lab machine
-
Go to https://www.dickinson.edu/virtual. This is the Dickinson Virtual Lab.
-
Click on the
Python
link. -
Make OneDrive available in your Virtual Lab machine. (You will only have to do this once. In future when you access the Virtual Lab, OneDrive will automatically be available.) Click and approve My Files in the bar above the main desktop display:
-
In the Windows search bar (bottom left), search for
IDLE
and chooseIDLE Python 3.13 64-bit
. -
Use
File | New File
to create a new file. This will be a Python source code file containing our first Python program. Python files should have a name that ends in.py
. Before typing the program in, save the file usingFile | Save As...
. Name the filegreetings.py
, and save it in yourclass01
folder on OneDrive. OneDrive should be available underThis PC
:
-
Type or paste this Python code into your file:
print("Greetings. I wonder if COMP130 will be fun AND useful AND enriching.")
Save the file, then run the program viaRun | Run Module
. -
If you have time, paste in more code and experiment with it. For example, try this:
topic = input('What is/was your first year seminar topic? ')
print('Nice!!', topic, 'sounds interesting.')
Or this:
import math
x = math.sqrt(2)
print("By the way, did you know that the square root of 2 is", x, "?")
Or this:
a = 7
b = 24
c = a + b
print("Also, the sum of", a, "and", b, "is", c)
Don’t worry if you don’t understand the code. We’ll learn all about it this semester.