This tutorial walks you through setting up the tools you need to begin developing in Python and Flask. Note: I assume you are on a Unix environment (OSX, Linux, Linux VM on Windows).
- Python 2.7.x
- easy_install and pip
- Git 1.7/1.8
- virtualenv
| /* | |
| 1. Download and run https://raw.githubusercontent.com/esp8266/Arduino/master/libraries/ESP8266WiFi/examples/BearSSL_CertStore/certs-from-mozilla.py | |
| 2. Make sure the `certs.ar` file is in the `data/` directory in your project. | |
| 3. Download and install ESP8266LittleFS (see https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#uploading-files-to-file-system) | |
| 4. Run Tools > ESP8266 LittleFS Data Upload | |
| 5. Upload this sketch | |
| /*************************************************** | |
| Adafruit MQTT Library ESP8266 Example |
| There are many already existing powerful http servers that can be used in python e.g. gevent, twisted web server. However, they are a bit complex to use and you cannot start them in a thread other than the main thread. | |
| Here is a sample of basic http server using "BaseHTTPRequestHandler". The example exposed two rest interfaces: | |
| To ingest records into the web server | |
| To retrieve already ingested records from the web server | |
| The records are assumed to be JSON based, however, any type of records can be ingested. | |
| [sourcecode language="python" wraplines="false" collapse="false"] | |
| from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer |
| from taxonomy_tree import TaxonomyTree | |
| taxonomy = TaxonomyTree() | |
| taxonomy.linguagens.script.python | |
| taxonomy.linguagens.script.perl | |
| taxonomy.linguagens.funcionais.elixir | |
| taxonomy.linguagens.funcionais.f_sharp | |
| taxonomy.databases.nosql.mongo | |
| taxonomy.databases.nosql.cassandra |
| __author__ = 'David Manouchehri' | |
| from bs4 import BeautifulSoup | |
| import urllib.request | |
| import gzip | |
| import io | |
| url = 'http://yoururlgoesherehopefullythisisntavalidurl.com/pages.html' | |
| headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', |
| require 'rubygems' | |
| require 'mechanize' | |
| agent = Mechanize.new | |
| agent.set_proxy('proxy.example.com', 80, 'username', 'password') | |
| agent.add_auth('http://hoge.com','b_username','b_password') | |
| agent.user_agent_alias = "Windows Mozilla" | |
| res = agent.get('http://hoge.com/some/page') | |
| puts res.body |
| class Node : | |
| def __init__( self, data ) : | |
| self.data = data | |
| self.next = None | |
| self.prev = None | |
| class LinkedList : | |
| def __init__( self ) : | |
| self.head = None |
| # -*- coding: utf-8 -*- | |
| """ | |
| Flaskr | |
| ~~~~~~ | |
| A microblog example application written as Flask tutorial with | |
| Flask and couchdbkit. | |
| :copyright: (c) 2010 by Armin Ronacher. | |
| :license: BSD, see LICENSE for more details. |