INTRO TO AI

Part 7 Appendix III

Mehmet Kerem Turkcan
Associate Research Scientist
Center for Smart Streetscapes, Columbia University
New York, USA
keremturkcan.com  ·  mkt2126@columbia.edu

Move with the arrow keys, a presentation clicker, or the buttons at the bottom left; the gear at the bottom right opens the slide settings.

The finished setup

At the end of the eight steps, one folder exists in two places, on GitHub and on this computer, and a browser opens the page stored inside it.

GitHub.com repository GitHub Desktop folder on this computer VS Code workspace browser 127.0.0.1 clone writes open serves
Four of the boxes are the same folder, as a repository online, as a copy written to disk, as an open workspace, and as a page in the browser; GitHub Desktop is the program that writes the copy.
Cost: a GitHub account, GitHub Desktop, and Visual Studio Code are free to download and to use.

Three programs and one folder

All three programs work on the same set of files, so a change recorded through one of them becomes visible in the other two.

ProgramWhere it runsWhat it does with the folder
GitHub.coma websiteKeeps the shared copy and its history
GitHub Desktopthis computerCopies the repository onto this computer and sends new commits back
Visual Studio Codethis computerOpens the files, edits them, and runs the servers

Download GitHub Desktop from desktop.github.com and Visual Studio Code from code.visualstudio.com. Sign in to your GitHub account inside GitHub Desktop before the first clone.

School devices: a managed laptop may block installation, so ask the technology staff to approve both programs beforehand.

What a repository is

Git is a version control system: it watches a folder and stores a complete snapshot of it each time you ask for one, through an action called a commit.

A repository is that folder together with every snapshot Git has stored for it.

History: the Linux kernel developers, and Linus Torvalds in particular, wrote Git in 2005, after BitKeeper, the version control system they had been using, stopped being free of charge.

orbit_lab .git every stored snapshot README.md index.html
The hidden .git folder stores the history; the files beside it are the ones you edit.

Step 1: a new repository on GitHub

  1. Sign in at github.com, select + in the upper right corner, then select New repository.
  2. Leave Owner set to your account and type a short name under Repository name.
  3. Write one line of Description.
  4. Choose Public or Private.
  5. Check Add a README file, then select Create repository.
github.com/new Create a new repository Owner adalovelace / Repository name orbit_lab 1 Description (optional) A small page about the planets 2 Public anyone can read it Private only invited people read it 3 Add a README file 4 Create repository 5
The account name and the description shown here are illustrative.

Public or private?

A class exercise about the planets contains no personal information. Which visibility fits it?

Public lets anyone who finds the repository read the files; the people you name are the only ones who may change them.

Private lets you and the people you invite read it.

Public suits the exercise, because classmates can then read the files without an invitation.

GitHub shows the contents of the README file underneath the file list, so that file carries the description of the project.

Checking Add a README file also gives the repository its first commit, so the clone in Step 2 arrives with a file already inside it.

Never store passwords, keys, or student records in a repository, because a later change of the visibility setting, made by you or by a collaborator, can let other people read a private repository.

The repository page

Creating the repository opens its page, which lists the files and shows the green Code button.

  1. Select Code.
  2. Select Open with GitHub Desktop.
  3. Allow the browser to start GitHub Desktop.
github.com/adalovelace/orbit_lab adalovelace / orbit_lab main Code Name README.md Initial commit Local HTTPS   SSH   GitHub CLI Open with GitHub Desktop Download ZIP
The Code button menu.

What cloning does

Cloning copies every file and the whole stored history from GitHub onto this computer, so you can keep editing and committing while the network is unavailable.

Afterwards the clone remembers the address of the repository on GitHub, so push sends your new commits to GitHub and pull copies other people's commits onto this computer.

GitHub repository files and history the clone files and history clone, pull push
Two copies of one repository, each with the complete files and history.

Step 2: the clone in GitHub Desktop

  1. GitHub Desktop opens the Clone a repository window with the Repository field already filled in.
  2. Read Local path, which names the place where the folder will be written.
  3. Select Choose… to pick a different place.
  4. Select Clone and wait for the copy to finish.
GitHub Desktop Clone a repository GitHub.com URL Repository adalovelace/orbit_lab Local path C:\Users\ada\Documents\GitHub Choose… Clone
The path shown is illustrative; the account name on your computer differs.

Step 3: the folder on this computer

In GitHub Desktop, choose Repository → Show in Explorer, or press Ctrl+Shift+F.

The window that opens shows the cloned files, and its address bar gives the exact place the clone was written to.

Windows hides the folder named .git, which contains the stored snapshots. Leave it untouched.

orbit_lab C:\Users\ada\Documents\GitHub\orbit_lab Name Notes .git hidden; stores the history README.md the description page
The folder on disk; the path shown is illustrative.
On macOS: the same menu item reads Show in Finder, and the shortcut uses Command instead of Ctrl.

Step 4: the folder in Visual Studio Code

  1. In GitHub Desktop, open File → Options → Integrations, set the external editor to Visual Studio Code, then press Ctrl+Shift+A.
  2. In Visual Studio Code, choose File → Open Folder and select the cloned folder.
EXPLORER ORBIT_LAB README.md README.md # orbit_lab A small page about the planets. main Ln 1, Col 1
The folder name stands at the top of the Explorer, and every file inside it is listed underneath; the clone starts with the README file alone.

The first file

Select the New File icon at the top of the Explorer, name the file index.html, and type these lines.

<!doctype html>
<html>
  <head><title>Orbit Lab</title></head>
  <body>
    <h1>Orbit Lab</h1>
    <p>Mercury is closest to the Sun.</p>
  </body>
</html>
<!doctype html>Announces which version of HTML follows
<head>Describes the page to the browser
<title>Names the browser tab
<body>Contains what the reader sees
<h1> <p>A heading and a paragraph
Why the name index.html: a server that receives a request for a folder looks inside it for a file with that name.

Step 5: the Live Server extension

  1. Open the Extensions view with Ctrl+Shift+X.
  2. Type live server in the search box.
  3. Confirm that the publisher reads Ritwick Dey.
  4. Select Install.

The Visual Studio Marketplace recorded more than 80 million installations of this extension by July 2026.

EXTENSIONS: MARKETPLACE live server Live Server Launch a local development server with live reload Ritwick Dey 80.7M installs Install Live Preview Microsoft
Several extensions match this search, so the publisher name identifies the right one to install.

Step 6: the Go Live button

  1. Open index.html in the editor.
  2. Select Go Live in the status bar along the bottom of the window.
  3. The default browser opens at http://127.0.0.1:5500.
main Ln 1, Col 1 Go Live main Ln 1, Col 1 Port : 5500 127.0.0.1:5500 Orbit Lab Mercury is closest to the Sun. select it
Once the server runs, the same button reads Port : 5500, and selecting it stops the server.

What does Go Live start?

Inside Visual Studio Code, Live Server starts a small web server, which listens on port 5500 and answers requests for the files in the open folder.

browser 127.0.0.1:5500 Live Server listens on 5500 orbit_lab index.html GET /index.html reads the file 200 OK, and the bytes of the file
The same exchange of one request and one response repeats for every image, stylesheet, and script that the page names.

Reading the address

The address that Live Server opened names four things at once.

http :// 127.0.0.1 : 5500 / index.html protocol host port path the language used which computer which program which file
Reading from the left: the protocol, the host, the port, and the path.

127.0.0.1 is the address a computer uses for itself, so the request never leaves this machine; the name localhost reaches the same place.

An address with no port makes the browser use 80 for http and 443 for https, which is why public addresses rarely show a number.

What happens when the file is saved?

Change the heading in index.html to <h1>Orbit Lab: Mercury</h1> and press Ctrl+S.

127.0.0.1:5500 Orbit Lab before the save 127.0.0.1:5500 Orbit Lab: Mercury after the save Ctrl+S
Live Server adds a small script to the served page, and that script reloads the page whenever the server reports that a file in the folder was saved.
Nothing left the computer: the browser asked Live Server for the file, and Live Server read it from the folder on this same disk.

What is Python?

The Python documentation describes Python as an interpreted, interactive, object oriented programming language, and credits it with remarkable power and very clear syntax.

Interpreted means that a program called the interpreter reads the source code one statement at a time and carries it out immediately, so a Python file runs without a separate compilation step.

Python includes a standard library, which is the collection of modules distributed with the language itself.

One of those modules, http.server, serves the files of a folder over HTTP, the protocol a browser uses to request a page, which is what the next steps use.

Where Python is used: web servers, data analysis, scientific computing, machine learning, and short scripts that automate repeated work.

Python's beginnings

Guido van Rossum began Python during the Christmas holidays of 1989 at CWI in Amsterdam, and released version 0.9.0 to the newsgroup alt.sources on February 20, 1991.

work begins version 0.9.0 version 1.0 version 2.0 version 3.0 Christmas 1989 February 20, 1991 January 26, 1994 October 16, 2000 December 3, 2008
Five milestones in release order, with even spacing between them.
The name: van Rossum was reading the published scripts of Monty Python's Flying Circus, a BBC comedy series of the 1970s, and wanted a name that was short, unique, and slightly mysterious.

A short Python program

planets = ["Mercury", "Venus", "Earth"]
for name in planets:
    print(name, len(name))
Mercury 7
Venus 5
Earth 5
  • The first line makes a list of three strings, which is what Python calls a piece of text.
  • The for line runs the indented line once for each item in the list, and each time it sets name to that item.
  • len(name) counts the characters, so Mercury gives 7 and Venus gives 5.
  • print writes its arguments, separated by a space, to the terminal.
Indentation carries meaning in Python: the four spaces mark which lines belong to the loop.

Step 7: a terminal in the editor

  1. In the menu bar at the top of the window, select Terminal.
  2. Select New Terminal, or press Ctrl+Shift+`.
README.md # orbit_lab A small page about the planets. File Edit Selection View Go Run Terminal Help New Terminal Ctrl+Shift+` Split Terminal Ctrl+Shift+5 Run Task… Run Build Task… Ctrl+Shift+B TERMINAL PS C:\Users\ada\Documents\GitHub\orbit_lab>
The terminal opens in the folder shown in the Explorer, so its prompt ends with the folder name.

Is Python on this computer?

Type this line in the terminal and press Enter.

python --version

When Python is installed, the terminal prints the version it found, such as Python 3.12.4 (illustrative).

Windows also provides a launcher called py, so py --version prints the version when python reports nothing.

If the Microsoft Store opens, or the terminal reports that python was not recognized, install Python from python.org, enable the option that adds Python to PATH, close the terminal, and open a new one.

PATH is the list of folders a terminal searches when it looks for a program name.

A new terminal reads PATH again, so a terminal that was already open before the installation keeps printing the old result.

Step 8: the Python server

With the terminal sitting in the project folder, type this line and press Enter.

python -m http.server 8000 --bind 127.0.0.1
PieceWhat it asks for
pythonStart the Python interpreter
-mRun a module from the standard library
http.serverThe module that serves the files of the current folder
8000The port to listen on
--bind 127.0.0.1Accept requests from this computer only
Not for production: the Python documentation warns against serving a public site with http.server, because the module implements only basic security checks.

What the terminal prints

Serving HTTP on 127.0.0.1 port 8000 (http://127.0.0.1:8000/) ...
127.0.0.1 - - [29/Jul/2026 10:14:03] "GET /index.html HTTP/1.1" 200 -

The first line appears once, when the server begins listening.

Each further line records one request: the address of the computer that sent it, the moment it arrived, the file it named, and the status code the server returned.

The date and time shown are illustrative.

200 is the status code for a file that the server found and sent.

404 is the status code for a name that matches no file in the folder.

This terminal accepts no further commands until the server stops, so press Ctrl+C in it when the session ends.

Live Server and the Python server

Live ServerPython http.server
Started byThe Go Live buttonA line typed in the terminal
Usual addresshttp://127.0.0.1:5500http://127.0.0.1:8000
NeedsThe installed extensionAn installed Python
Reloads the page after a saveYesNo; reload the page yourself
Stopped bySelecting Port : 5500 in the status barCtrl+C
Both servers may run at once, because they listen on different ports, so the files of the same folder are served at 5500 and at 8000.

Is the page on the internet?

Misconception

“The page is on the internet now, so I can send the address to a classmate.”

127.0.0.1 names the computer that asks, so a classmate who types that address reaches their own computer and finds nothing there.

Readers elsewhere need a hosting service, which keeps the files on a computer that answers requests sent to a public address.

Once the page works on this computer, the usual next step is GitHub Pages, which serves the files of a repository at a public address.

First actions for six common failures

Message or symptomWhere it comes fromWhat to do first
“python is not recognized”Python is missing from PATHInstall Python, then open a new terminal
“Address already in use”Another program is already listening on 8000Run the command again with 8001
The browser lists file namesThe folder has no index.html in itCreate index.html in the folder
The browser reports 404The address names a file that is absentCompare the spelling with the Explorer
Go Live is absentNo folder is open, or the extension is missingOpen the folder, then check Extensions
The browser shows the old textThe browser served the page from its cacheReload the page with Ctrl+F5

Sending the work back to GitHub

  1. Open GitHub Desktop, which lists every file you changed.
  2. Write one short line in Summary.
  3. Select Commit to main, which records the snapshot on this computer.
  4. Select Push origin, which sends the snapshot to GitHub.

Reloading the repository page then shows index.html beside the README file.

A commit records a snapshot in the clone. A push copies the new snapshots to GitHub, so the two copies match again.

Commit often, with a summary naming what changed, because a clear history lets you return to any earlier working version.

The eight steps in order

1 Create the repository 2 Clone with GitHub Desktop 3 Open the folder 4 Open it in VS Code 5 Install Live Server 6 Go Live port 5500 7 Open a terminal 8 Serve port 8000
Steps 1 to 4 put the folder on this computer, and steps 5 to 8 serve it to a browser.

A checklist for the first session

  1. The repository page on GitHub lists README.md.
  2. GitHub Desktop shows the repository name and the local path.
  3. The Explorer in Visual Studio Code shows the folder name and index.html.
  4. The status bar shows Port : 5500 while Live Server runs.
  5. Running python --version prints a version line.
  6. The browser opens http://127.0.0.1:8000 and shows the heading.
  7. Both servers are stopped at the end of the session.
Stop the servers before closing the laptop, so no program keeps a port open after the session.

Sources: GitHub and the editor

Documentation accessed July 29, 2026.

Sources: Python and the web

Documentation accessed July 29, 2026.

Mehmet Kerem Turkcan; Associate Research Scientist; Center for Smart Streetscapes, Columbia University; New York, USA; keremturkcan.com; mkt2126@columbia.edu

Intro to AI, Part 7 Appendix IIIFrom a GitHub Repository to a Live Page