10 2017 档案

摘要:## test_module.py from user_modules import User,session def add_user(): person=User(username='haha',passwd='123') #session.add(person) session.add_all 阅读全文
posted @ 2017-10-29 22:03 nanaindi 阅读(503) 评论(0) 推荐(0) 编辑
摘要:sqlalchemy 1.pip install sqlalchemy 2.pip install pymsql connect.py ''' sqlalchemy ''' from sqlalchemy import create_engine HOSTNAME='127.0.0.1' PORT= 阅读全文
posted @ 2017-10-29 21:57 nanaindi 阅读(193) 评论(0) 推荐(0) 编辑
摘要:## 06ui.py #coding:utf-8 import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from tornado.options import define,options import util.ui_methods import util.ui_m... 阅读全文
posted @ 2017-10-29 13:36 nanaindi 阅读(460) 评论(0) 推荐(0) 编辑
摘要:## 06ui.py #coding:utf-8 import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from tornado.options import define, 阅读全文
posted @ 2017-10-27 09:57 nanaindi 阅读(206) 评论(0) 推荐(0) 编辑
摘要:1 # 多继承 2 class A: 3 def show(self): 4 print('AAAA') 5 6 class B: 7 def fun(self): 8 print('BBBB') 9 10 class C(B,A): 11 pass 12 13 x = C() 14 15 16 # 阅读全文
posted @ 2017-10-26 22:53 nanaindi 阅读(148) 评论(0) 推荐(0) 编辑
摘要:继承:模板继承使用extends标签实现。通过使用block来给子模板开放接口。1、extends必须是模板中的第一个出现的标签。2、子模板中的所有内容,必须出现在父模板定义好的block中,否则tornado将不会渲染。3、如果出现重复代码,就应该考虑使用模板。4、尽可能多的定义block,方便子 阅读全文
posted @ 2017-10-25 22:58 nanaindi 阅读(117) 评论(0) 推荐(0) 编辑
摘要:1 #test04.py 2 import tornado.httpserver 3 import tornado.ioloop 4 import tornado.options 5 import tornado.web 6 7 from tornado.options import define, 阅读全文
posted @ 2017-10-25 09:20 nanaindi 阅读(212) 评论(0) 推荐(0) 编辑
摘要:python使用pip安装模块时报错:unable to create process using ' '的解决方法: 参考:http://qoogle.cn/?id=39 1、删除C:\Python36\Lib\site-packages下的pip文件夹! 2、在官网重新下载最新的pip-9.0. 阅读全文
posted @ 2017-10-23 22:56 nanaindi 阅读(4068) 评论(0) 推荐(0) 编辑
摘要:```python # -*- coding: cp936 -*- import urllib,urllib2 from bs4 import BeautifulSoup user_agent='Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.221 Safa... 阅读全文
posted @ 2017-10-12 13:08 nanaindi 阅读(136) 评论(0) 推荐(0) 编辑
摘要:``` py2版本: coding:utf 8 from __future__ import unicode_liter import urllib,urllib2,time import re,sys,os headers={ 'Referer':'http://jandan.net/', 'Us 阅读全文
posted @ 2017-10-02 00:20 nanaindi 阅读(161) 评论(0) 推荐(0) 编辑
摘要:``` #-*- coding:utf-8 -*- #from __future__ import unicode_liter import urllib,urllib2 import re,sys,os,time headers={ 'Referer':'http://jandan.net/', 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64)... 阅读全文
posted @ 2017-10-02 00:13 nanaindi 阅读(165) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示