07 2018 档案
摘要:Pirates Booty Move mouse to find coordinate..
阅读全文
摘要:1、用title属性作为工具提示 2、链接到锚点 3、斜体 4、指定新窗口 5、链接上一个目录:../images/good.jpg 6、图像元素, 单标记 7、alt属性,当图片显示不出来时,alt起作用 8、img width、height属性确定图片大小,默认是像素指定 9、web字体 @font-face { font...
阅读全文
摘要:Planets Green Planet All is well Red planet Nothing to report Blue planet All system A-OK
阅读全文
摘要://获取0-4整数 var randomLoc = Math.floor(Math.random() * 5);
阅读全文
摘要:#coding=utf-8 #app.py from flask import Flask from flask import render_template from book.book import book_bp from configs import config def create_app(config_name): app = Flask(__name__) ...
阅读全文
摘要:#消息闪现 @book_bp.route("/book", methods=["GET", "POST"]) def handle_book(): if request.method == "POST": title = request.form.get("title") if title: books.append(title) ...
阅读全文
摘要:#coding=utf-8 from flask import Blueprint, request, render_template, redirect, url_for, flash #创建一个蓝图 传入参数分别是蓝图名称,蓝图所在目录,必选, 其余为可选,如果静态文件所在目录 book_bp = Blueprint("book", __name__, template_folder="....
阅读全文
摘要:#coding=utf-8 from flask import Flask from flask import request from flask import redirect from flask import url_for from flask import render_template from flask import session app = Flask(__name__...
阅读全文
摘要:#coding=utf-8 from flask import Flask from flask import request from flask import redirect app = Flask(__name__) @app.route("/home") def hello_world(): return "hello world" @app.route("/user...
阅读全文
摘要:jinja2主要语法 1、变量 {{name}} 2、控制语句 {% if %} {{name}} {% else %} {{name2}} {% endif%} 3、宏 {% macro check_user(user) %} {% if user=="wang" %} {{user}} {% endif %} {% end macro...
阅读全文
摘要:from flask import Flask app = Flask(__name__) @app.route('/') def hello_world(username): return 'Hello %s!' % username @app.route("/user/") def hello_page(id): return "This is page %d" %...
阅读全文
摘要:#coding=utf-8 #python 多线程 #原函数 def execute_slowly(a, b, c): pass #多线程 from threading import Thread t = Thread(target=execute_slowly, args=(a, b, c)) t.start()
阅读全文
摘要:#coding=utf-8 class YouNeedError(Exception): pass try: raise YouNeedError("lola") except Exception as e: print str(e)
阅读全文
摘要:捕获异常的两种方式 方法一 #coding=utf-8 import sys try: with open("ddd.txt", "r") as f: data = f.read() print data except: err = sys.exc_info() print err sys.exc_info()返回三元组,分别是,异常...
阅读全文