1346 lines
36 KiB
HTML
1346 lines
36 KiB
HTML
|
||
<!doctype html>
|
||
<html lang="en" class="no-js">
|
||
<head>
|
||
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
||
|
||
|
||
|
||
<link rel="shortcut icon" href="../../img/favicon.ico">
|
||
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-6.1.5">
|
||
|
||
|
||
|
||
<title>Introduction - SchoolOfSRE</title>
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="../../assets/stylesheets/main.21aed14c.min.css">
|
||
|
||
|
||
<link rel="stylesheet" href="../../assets/stylesheets/palette.196e0c26.min.css">
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
|
||
<style>body,input{font-family:"Roboto",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono",SFMono-Regular,Consolas,Menlo,monospace}</style>
|
||
|
||
|
||
|
||
|
||
<link rel="stylesheet" href="../../stylesheets/custom.css">
|
||
|
||
|
||
|
||
|
||
|
||
</head>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="none" data-md-color-accent="none">
|
||
|
||
|
||
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
|
||
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
|
||
<label class="md-overlay" for="__drawer"></label>
|
||
<div data-md-component="skip">
|
||
|
||
|
||
<a href="#python-and-the-web" class="md-skip">
|
||
Skip to content
|
||
</a>
|
||
|
||
</div>
|
||
<div data-md-component="announce">
|
||
|
||
</div>
|
||
|
||
|
||
|
||
<header class="md-header" data-md-component="header">
|
||
<nav class="md-header-nav md-grid" aria-label="Header">
|
||
<a href="../.." title="SchoolOfSRE" class="md-header-nav__button md-logo" aria-label="SchoolOfSRE">
|
||
|
||
<img src="../../img/sos.png" alt="logo">
|
||
|
||
</a>
|
||
<div class="md-header-nav__title" data-md-component="header-title">
|
||
|
||
<div class="md-header-nav__ellipsis">
|
||
<span class="md-header-nav__topic md-ellipsis">
|
||
<a href="../.." title="SchoolOfSRE" >
|
||
SchoolOfSRE
|
||
</a>
|
||
</span>
|
||
<span class="md-header-nav__topic md-ellipsis">
|
||
|
||
Introduction
|
||
|
||
</span>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<label class="md-header-nav__button md-icon" for="__search">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
|
||
</label>
|
||
|
||
<div class="md-search" data-md-component="search" role="dialog">
|
||
<label class="md-search__overlay" for="__search"></label>
|
||
<div class="md-search__inner" role="search">
|
||
<form class="md-search__form" name="search">
|
||
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required>
|
||
<label class="md-search__icon md-icon" for="__search">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
|
||
</label>
|
||
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" data-md-component="search-reset" tabindex="-1">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
|
||
</button>
|
||
</form>
|
||
<div class="md-search__output">
|
||
<div class="md-search__scrollwrap" data-md-scrollfix>
|
||
<div class="md-search-result" data-md-component="search-result">
|
||
<div class="md-search-result__meta">
|
||
Initializing search
|
||
</div>
|
||
<ol class="md-search-result__list"></ol>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</nav>
|
||
</header>
|
||
|
||
<div class="md-container" data-md-component="container">
|
||
|
||
|
||
|
||
|
||
<main class="md-main" data-md-component="main">
|
||
<div class="md-main__inner md-grid">
|
||
|
||
|
||
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
|
||
<div class="md-sidebar__scrollwrap">
|
||
<div class="md-sidebar__inner">
|
||
|
||
|
||
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
|
||
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../.." class="md-nav__link">
|
||
Home
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2" >
|
||
<label class="md-nav__link" for="nav-2">
|
||
Fundamentals Series
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Fundamentals Series" data-md-level="1">
|
||
<label class="md-nav__title" for="nav-2">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Fundamentals Series
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-1" type="checkbox" id="nav-2-1" >
|
||
<label class="md-nav__link" for="nav-2-1">
|
||
Linux Basics
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Linux Basics" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-2-1">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Linux Basics
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_basics/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_basics/command_line_basics/" class="md-nav__link">
|
||
Command Line Basics
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_basics/linux_server_administration/" class="md-nav__link">
|
||
Server Administration
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_basics/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-2" type="checkbox" id="nav-2-2" >
|
||
<label class="md-nav__link" for="nav-2-2">
|
||
Git
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Git" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-2-2">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Git
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../git/git-basics/" class="md-nav__link">
|
||
Git Basics
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../git/branches/" class="md-nav__link">
|
||
Working With Branches
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../git/github-hooks/" class="md-nav__link">
|
||
Github and Hooks
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../git/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2-3" type="checkbox" id="nav-2-3" >
|
||
<label class="md-nav__link" for="nav-2-3">
|
||
Linux Networking
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Linux Networking" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-2-3">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Linux Networking
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_networking/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_networking/dns/" class="md-nav__link">
|
||
DNS
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_networking/udp/" class="md-nav__link">
|
||
UDP
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_networking/http/" class="md-nav__link">
|
||
HTTP
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_networking/tcp/" class="md-nav__link">
|
||
TCP
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_networking/ipr/" class="md-nav__link">
|
||
Routing
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../linux_networking/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3" checked>
|
||
<label class="md-nav__link" for="nav-3">
|
||
Python and Web
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Python and Web" data-md-level="1">
|
||
<label class="md-nav__title" for="nav-3">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Python and Web
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--active">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
|
||
|
||
|
||
|
||
|
||
<label class="md-nav__link md-nav__link--active" for="__toc">
|
||
Introduction
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
|
||
<a href="./" class="md-nav__link md-nav__link--active">
|
||
Introduction
|
||
</a>
|
||
|
||
|
||
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
||
|
||
|
||
|
||
|
||
|
||
<label class="md-nav__title" for="__toc">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Table of contents
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#prerequisites" class="md-nav__link">
|
||
Prerequisites
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#what-to-expect-from-this-course" class="md-nav__link">
|
||
What to expect from this course
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#what-is-not-covered-under-this-course" class="md-nav__link">
|
||
What is not covered under this course
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#lab-environment-setup" class="md-nav__link">
|
||
Lab Environment Setup
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#course-contents" class="md-nav__link">
|
||
Course Contents
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#the-python-language" class="md-nav__link">
|
||
The Python Language
|
||
</a>
|
||
|
||
<nav class="md-nav" aria-label="The Python Language">
|
||
<ul class="md-nav__list">
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#compiled-vs-interpreted" class="md-nav__link">
|
||
Compiled vs. Interpreted
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#running-the-programs" class="md-nav__link">
|
||
Running The Programs
|
||
</a>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
</nav>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</nav>
|
||
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../python-concepts/" class="md-nav__link">
|
||
Some Python Concepts
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../python-web-flask/" class="md-nav__link">
|
||
Python, Web and Flask
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../url-shorten-app/" class="md-nav__link">
|
||
The URL Shortening App
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../sre-conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4" >
|
||
<label class="md-nav__link" for="nav-4">
|
||
Data
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Data" data-md-level="1">
|
||
<label class="md-nav__title" for="nav-4">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Data
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-4-1" type="checkbox" id="nav-4-1" >
|
||
<label class="md-nav__link" for="nav-4-1">
|
||
Relational Databases
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Relational Databases" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-4-1">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Relational Databases
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../databases_sql/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../databases_sql/concepts/" class="md-nav__link">
|
||
Key Concepts
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../databases_sql/mysql/" class="md-nav__link">
|
||
MySQL
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../databases_sql/innodb/" class="md-nav__link">
|
||
InnoDB
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../databases_sql/operations/" class="md-nav__link">
|
||
Operational Concepts
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../databases_sql/lab/" class="md-nav__link">
|
||
Lab
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../databases_sql/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-4-2" type="checkbox" id="nav-4-2" >
|
||
<label class="md-nav__link" for="nav-4-2">
|
||
NoSQL
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="NoSQL" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-4-2">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
NoSQL
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../databases_nosql/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../databases_nosql/key_concepts/" class="md-nav__link">
|
||
Key Concepts
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../databases_nosql/further_reading/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-4-3" type="checkbox" id="nav-4-3" >
|
||
<label class="md-nav__link" for="nav-4-3">
|
||
Big Data
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Big Data" data-md-level="2">
|
||
<label class="md-nav__title" for="nav-4-3">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Big Data
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../big_data/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../big_data/evolution/" class="md-nav__link">
|
||
Evolution and Architecture of Hadoop
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../big_data/tasks/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5" >
|
||
<label class="md-nav__link" for="nav-5">
|
||
Systems Design
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Systems Design" data-md-level="1">
|
||
<label class="md-nav__title" for="nav-5">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Systems Design
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../systems_design/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../systems_design/scalability/" class="md-nav__link">
|
||
Scalability
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../systems_design/availability/" class="md-nav__link">
|
||
Availability
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../systems_design/fault-tolerance/" class="md-nav__link">
|
||
Fault Tolerance
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../systems_design/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item md-nav__item--nested">
|
||
|
||
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-6" type="checkbox" id="nav-6" >
|
||
<label class="md-nav__link" for="nav-6">
|
||
Security
|
||
<span class="md-nav__icon md-icon"></span>
|
||
</label>
|
||
<nav class="md-nav" aria-label="Security" data-md-level="1">
|
||
<label class="md-nav__title" for="nav-6">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Security
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../security/intro/" class="md-nav__link">
|
||
Introduction
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../security/fundamentals/" class="md-nav__link">
|
||
Fundamentals of Security
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../security/network_security/" class="md-nav__link">
|
||
Network Security
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../security/threats_attacks_defences/" class="md-nav__link">
|
||
Threat, Attacks & Defences
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../security/writing_secure_code/" class="md-nav__link">
|
||
Writing Secure code
|
||
</a>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../security/conclusion/" class="md-nav__link">
|
||
Conclusion
|
||
</a>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</li>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<li class="md-nav__item">
|
||
<a href="../../CONTRIBUTING/" class="md-nav__link">
|
||
Contribute
|
||
</a>
|
||
</li>
|
||
|
||
|
||
</ul>
|
||
</nav>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
|
||
<div class="md-sidebar__scrollwrap">
|
||
<div class="md-sidebar__inner">
|
||
|
||
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
|
||
|
||
|
||
|
||
|
||
|
||
<label class="md-nav__title" for="__toc">
|
||
<span class="md-nav__icon md-icon"></span>
|
||
Table of contents
|
||
</label>
|
||
<ul class="md-nav__list" data-md-scrollfix>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#prerequisites" class="md-nav__link">
|
||
Prerequisites
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#what-to-expect-from-this-course" class="md-nav__link">
|
||
What to expect from this course
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#what-is-not-covered-under-this-course" class="md-nav__link">
|
||
What is not covered under this course
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#lab-environment-setup" class="md-nav__link">
|
||
Lab Environment Setup
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#course-contents" class="md-nav__link">
|
||
Course Contents
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#the-python-language" class="md-nav__link">
|
||
The Python Language
|
||
</a>
|
||
|
||
<nav class="md-nav" aria-label="The Python Language">
|
||
<ul class="md-nav__list">
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#compiled-vs-interpreted" class="md-nav__link">
|
||
Compiled vs. Interpreted
|
||
</a>
|
||
|
||
</li>
|
||
|
||
<li class="md-nav__item">
|
||
<a href="#running-the-programs" class="md-nav__link">
|
||
Running The Programs
|
||
</a>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
</nav>
|
||
|
||
</li>
|
||
|
||
</ul>
|
||
|
||
</nav>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="md-content">
|
||
<article class="md-content__inner md-typeset">
|
||
|
||
|
||
|
||
<h1 id="python-and-the-web">Python and The Web</h1>
|
||
<h2 id="prerequisites">Prerequisites</h2>
|
||
<ul>
|
||
<li>Basic understanding of python language.</li>
|
||
<li>Basic familiarity with flask framework.</li>
|
||
</ul>
|
||
<h2 id="what-to-expect-from-this-course">What to expect from this course</h2>
|
||
<p>This course is divided into two high level parts. In the first part, assuming familiarity with python language’s basic operations and syntax usage, we will dive a little deeper into understanding python as a language. We will compare python with other programming languages that you might already know like Java and C. We will also explore concepts of Python objects and with help of that, explore python features like decorators.</p>
|
||
<p>In the second part which will revolve around the web, and also assume familiarity with the Flask framework, we will start from the socket module and work with HTTP requests. This will demystify how frameworks like flask work internally.</p>
|
||
<p>And to introduce SRE flavour to the course, we will design, develop and deploy (in theory) a URL shortening application. We will emphasize parts of the whole process that are more important as an SRE of the said app/service.</p>
|
||
<h2 id="what-is-not-covered-under-this-course">What is not covered under this course</h2>
|
||
<p>Extensive knowledge of python internals and advanced python.</p>
|
||
<h2 id="lab-environment-setup">Lab Environment Setup</h2>
|
||
<p>Have latest version of python installed</p>
|
||
<h2 id="course-contents">Course Contents</h2>
|
||
<ol>
|
||
<li><a href="https://linkedin.github.io/school-of-sre/python_web/intro/#the-python-language">The Python Language</a><ol>
|
||
<li>Some Python Concepts</li>
|
||
<li>Python Gotchas</li>
|
||
</ol>
|
||
</li>
|
||
<li><a href="https://linkedin.github.io/school-of-sre/python_web/python-web-flask/">Python and Web</a><ol>
|
||
<li>Sockets</li>
|
||
<li>Flask</li>
|
||
</ol>
|
||
</li>
|
||
<li><a href="https://linkedin.github.io/school-of-sre/python_web/url-shorten-app/">The URL Shortening App</a><ol>
|
||
<li>Design</li>
|
||
<li>Scaling The App</li>
|
||
<li>Monitoring The App</li>
|
||
</ol>
|
||
</li>
|
||
</ol>
|
||
<h2 id="the-python-language">The Python Language</h2>
|
||
<p>Assuming you know a little bit of C/C++ and Java, let's try to discuss the following questions in context of those two languages and python. You might have heard that C/C++ is a compiled language while python is an interpreted language. Generally, with compiled language we first compile the program and then run the executable while in case of python we run the source code directly like <code>python hello_world.py</code>. While Java, being an interpreted language, still has a separate compilation step and then its run. So what's really the difference?</p>
|
||
<h3 id="compiled-vs-interpreted">Compiled vs. Interpreted</h3>
|
||
<p>This might sound a little weird to you: python, in a way is a compiled language! Python has a compiler built-in! It is obvious in the case of java since we compile it using a separate command ie: <code>javac helloWorld.java</code> and it will produce a <code>.class</code> file which we know as a <em>bytecode</em>. Well, python is very similar to that. One difference here is that there is no separate compile command/binary needed to run a python program.</p>
|
||
<p><strong>What is the difference then, between java and python?</strong>
|
||
Well, Java's compiler is more strict and sophisticated. As you might know Java is a statically typed language. So the compiler is written in a way that it can verify types related errors during compile time. While python being a <em>dynamic</em> language, types are not known until a program is run. So in a way, python compiler is dumb (or, less strict). But there indeed is a compile step involved when a python program is run. You might have seen python bytecode files with <code>.pyc</code> extension. Here is how you can see bytecode for a given python program.</p>
|
||
<pre><code class="language-bash"># Create a Hello World
|
||
spatel1-mn1:tmp spatel1$ echo "print('hello world')" > hello_world.py
|
||
|
||
# Making sure it runs
|
||
spatel1-mn1:tmp spatel1$ python3 hello_world.py
|
||
hello world
|
||
|
||
# The bytecode of the given program
|
||
spatel1-mn1:tmp spatel1$ python -m dis hello_world.py
|
||
1 0 LOAD_NAME 0 (print)
|
||
2 LOAD_CONST 0 ('hello world')
|
||
4 CALL_FUNCTION 1
|
||
6 POP_TOP
|
||
8 LOAD_CONST 1 (None)
|
||
10 RETURN_VALUE
|
||
</code></pre>
|
||
<p>Read more about dis module <a href="https://docs.python.org/3/library/dis.html">here</a></p>
|
||
<p>Now coming to C/C++, there of course is a compiler. But the output is different than what java/python compiler would produce. Compiling a C program would produce what we also know as <em>machine code</em>. As opposed to bytecode.</p>
|
||
<h3 id="running-the-programs">Running The Programs</h3>
|
||
<p>We know compilation is involved in all 3 languages we are discussing. Just that the compilers are different in nature and they output different types of content. In case of C/C++, the output is machine code which can be directly read by your operating system. When you execute that program, your OS will know how exactly to run it. <strong>But this is not the case with bytecode.</strong></p>
|
||
<p>Those bytecodes are language specific. Python has its own set of bytecode defined (more in <code>dis</code> module) and so does java. So naturally, your operating system will not know how to run it. To run this bytecode, we have something called Virtual Machines. Ie: The JVM or the Python VM (CPython, Jython). These so called Virtual Machines are the programs which can read the bytecode and run it on a given operating system. Python has multiple VMs available. Cpython is a python VM implemented in C language, similarly Jython is a Java implementation of python VM. <strong>At the end of the day, what they should be capable of is to understand python language syntax, be able to compile it to bytecode and be able to run that bytecode.</strong> You can implement a python VM in any language! (And people do so, just because it can be done)</p>
|
||
<pre><code> The Operating System
|
||
|
||
+------------------------------------+
|
||
| |
|
||
| |
|
||
| |
|
||
hello_world.py Python bytecode | Python VM Process |
|
||
| |
|
||
+----------------+ +----------------+ | +----------------+ |
|
||
|print(... | COMPILE |LOAD_CONST... | | |Reads bytecode | |
|
||
| +--------------->+ +------------------->+line by line | |
|
||
| | | | | |and executes. | |
|
||
| | | | | | | |
|
||
+----------------+ +----------------+ | +----------------+ |
|
||
| |
|
||
| |
|
||
| |
|
||
hello_world.c OS Specific machinecode | A New Process |
|
||
| |
|
||
+----------------+ +----------------+ | +----------------+ |
|
||
|void main() { | COMPILE | binary contents| | | binary contents| |
|
||
| +--------------->+ +------------------->+ | |
|
||
| | | | | | | |
|
||
| | | | | | | |
|
||
+----------------+ +----------------+ | +----------------+ |
|
||
| (binary contents |
|
||
| runs as is) |
|
||
| |
|
||
| |
|
||
+------------------------------------+
|
||
</code></pre>
|
||
<p>Two things to note for above diagram:</p>
|
||
<ol>
|
||
<li>Generally, when we run a python program, a python VM process is started which reads the python source code, compiles it to byte code and run it in a single step. Compiling is not a separate step. Shown only for illustration purpose.</li>
|
||
<li>Binaries generated for C like languages are not <em>exactly</em> run as is. Since there are multiple types of binaries (eg: ELF), there are more complicated steps involved in order to run a binary but we will not go into that since all that is done at OS level.</li>
|
||
</ol>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</article>
|
||
</div>
|
||
</div>
|
||
</main>
|
||
|
||
|
||
<footer class="md-footer">
|
||
|
||
<div class="md-footer-nav">
|
||
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
|
||
|
||
<a href="../../linux_networking/conclusion/" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
|
||
<div class="md-footer-nav__button md-icon">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
|
||
</div>
|
||
<div class="md-footer-nav__title">
|
||
<div class="md-ellipsis">
|
||
<span class="md-footer-nav__direction">
|
||
Previous
|
||
</span>
|
||
Conclusion
|
||
</div>
|
||
</div>
|
||
</a>
|
||
|
||
|
||
<a href="../python-concepts/" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
|
||
<div class="md-footer-nav__title">
|
||
<div class="md-ellipsis">
|
||
<span class="md-footer-nav__direction">
|
||
Next
|
||
</span>
|
||
Some Python Concepts
|
||
</div>
|
||
</div>
|
||
<div class="md-footer-nav__button md-icon">
|
||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
|
||
</div>
|
||
</a>
|
||
|
||
</nav>
|
||
</div>
|
||
|
||
<div class="md-footer-meta md-typeset">
|
||
<div class="md-footer-meta__inner md-grid">
|
||
<div class="md-footer-copyright">
|
||
|
||
Made with
|
||
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
|
||
Material for MkDocs
|
||
</a>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</footer>
|
||
|
||
</div>
|
||
|
||
<script src="../../assets/javascripts/vendor.7e0ee788.min.js"></script>
|
||
<script src="../../assets/javascripts/bundle.b3a72adc.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}</script>
|
||
|
||
<script>
|
||
app = initialize({
|
||
base: "../..",
|
||
features: [],
|
||
search: Object.assign({
|
||
worker: "../../assets/javascripts/worker/search.4ac00218.min.js"
|
||
}, typeof search !== "undefined" && search)
|
||
})
|
||
</script>
|
||
|
||
|
||
</body>
|
||
</html> |