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 -*- | |
target_url = "https://www.khanacademy.org/" | |
# ------------------------------------------------------- | |
import whois | |
#print whois.whois(target_url) | |
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
from webtest import TestApp | |
import demo_2 | |
def test_index(): | |
app = TestApp(demo_2.app) | |
assert app.get("/").text == u"Hello world @ MOSUT x Tainan.py" |
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
from pyquery import PyQuery as pq | |
#d = pq("<html></html>") | |
#d = pq(filename=path_to_html_file) | |
d = pq(url='http://www.csie.ncku.edu.tw/new/nckucsie/') | |
import pdb; pdb.set_trace(); | |
pass |
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 requests | |
r = requests.get("https://google.com.tw") | |
import pdb; pdb.set_trace(); | |
pass |
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
from bottle import Bottle, run | |
app = Bottle() | |
@app.route('/') | |
def index(): | |
return "Hello world @ MOSUT x Tainan.py" | |
if __name__ == "__main__": | |
run(app, host="localhost", port=8000) |
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
# From Thinker: http://pastebin.com/yzy0TjRn | |
import BaseHTTPServer | |
class handler(BaseHTTPServer.BaseHTTPRequestHandler): pass | |
handler.do_GET = lambda x: x.wfile.write('\nHello world @ Tainan.py x MOSUT') | |
BaseHTTPServer.HTTPServer(('', 8000), handler).serve_forever() |