- Navigate on your web browser to https://www.python.org/downloads
- Click on Download Python 2.7.11
- Install the downloaded package using the default settings
- Open a terminal prompt: WindowsKey + R -> cmd.exe -> Enter
- Type: c:\python27\scripts\pip.exe install bottle
- Open windows explorer, navigate to your Documents folder, create a new folder called webdev1 and navigate to it
- Press Alt key on keyboard, click on File -> New -> Text Document
- Name your new file test1.py and open it with a text editor, standard notepad will do, but you will not be able to edit it by double-clicking on the file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
RESP=$(cat <<EOF | fzf | |
Logout | |
Sleep | |
Reboot | |
Shutdown | |
EOF | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import json | |
import sqlite3 | |
from http.server import HTTPServer, BaseHTTPRequestHandler | |
conn = sqlite3.connect('requests.db') | |
cur = conn.cursor() | |
cur.execute('''CREATE TABLE IF NOT EXISTS requests (id integer primary key, datetime text, method text, headers text, body blob)''') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import signal | |
from random import random | |
_stop_all = [] | |
simulate_erros = [] | |
@asyncio.coroutine | |
def consumer(queue): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PersistentDict(object): | |
def __init__(self, store_file): | |
self._store_file = store_file | |
self._is_modified = False | |
self.reload() | |
def reload(self): | |
if self._is_modified: | |
raise Exception('data was modified and not persisted') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import gettext | |
import re | |
import threading | |
from datetime import datetime, time | |
import pytz | |
from babel import dates, numbers | |
NewerOlder