上一页 1 2 3 4 5 6 7 8 9 ··· 47 下一页
摘要: 捕获异常的两种方式 方法一 #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()返回三元组,分别是,异常... 阅读全文
posted @ 2018-07-04 08:27 道高一尺 阅读(382) 评论(0) 推荐(0) 编辑
摘要: 一、安装编译工具及库文件 yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel 二、首先要安装 PCRE PCRE 作用是让 Nginx 支持 Rewrite 功能。 1、下载 PCRE 安装包,下载地址: http://downloads.sourceforge.net/project/pcre... 阅读全文
posted @ 2018-06-27 16:53 道高一尺 阅读(177) 评论(0) 推荐(0) 编辑
摘要: #coding=utf-8 #repr方法字符串输出实例对象的值 class CountFromBy(object): def __init__(self, val=0, incr=1): self.val = val self.incr = incr def increase(self): self.val += self.i... 阅读全文
posted @ 2018-06-26 08:25 道高一尺 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 1、建立发布文件夹,内涵README.txt, setup.py vsearch.py(自写程序) 其中 setup.py如下 #coding=utf-8 from setuptools import setup setup( name = "vsearch", version = "1.0", description = "The head first Python... 阅读全文
posted @ 2018-06-12 07:26 道高一尺 阅读(260) 评论(0) 推荐(0) 编辑
摘要: #coding=utf-8 m = {"a", "b", "c", "d"} n = {"d", "e", "f", "b"} #并集 p = m.union(n) print p #哪些不是共有元素 q = m.difference(n) print q #查找共同元素 r = m.intersection(n) print r 阅读全文
posted @ 2018-06-07 07:29 道高一尺 阅读(126) 评论(0) 推荐(0) 编辑
摘要: {% block head %} {% include ['includes/_head.html', 'include/_metas.html'] %} {% endblock head %} {% block header %}{% endblock header %} {% for item i... 阅读全文
posted @ 2018-05-12 09:26 道高一尺 阅读(270) 评论(0) 推荐(0) 编辑
摘要: #coding=utf-8 from flask import Flask from flask_script import Manager app = Flask(__name__) manager = Manager(app) @app.route("/") def upload(): return "hello nihao" @manager.command def d... 阅读全文
posted @ 2018-05-07 08:12 道高一尺 阅读(514) 评论(0) 推荐(0) 编辑
摘要: python导出安装包及版本 pip freeze > requirements.txt批量安装pip install -r requirements.txt 阅读全文
posted @ 2018-05-06 19:00 道高一尺 阅读(418) 评论(0) 推荐(0) 编辑
摘要: #coding=utf-8 import os from flask import Flask from flask import request from flask import redirect from flask import url_for from flask import render_template from werkzeug.utils import secure_fil... 阅读全文
posted @ 2018-05-04 09:10 道高一尺 阅读(216) 评论(0) 推荐(0) 编辑
摘要: #coding=utf-8 from flask import Flask from flask import request app = Flask(__name__) @app.route("/login", methods=["GET", "POST"]) def hello_str(): if request.method == "POST": usern... 阅读全文
posted @ 2018-05-03 15:13 道高一尺 阅读(17257) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 47 下一页