会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
tangqiu
博客园
首页
新随笔
联系
订阅
管理
2020年5月13日
Python基础知识总结
摘要:
阅读全文
posted @ 2020-05-13 22:00 tangqiu
阅读(154)
评论(0)
推荐(0)
2020年3月29日
Python 实例方法、类方法、静态方法
摘要: 实例方法 定义:第一个参数必须是实例对象,该参数名一般约定为“self”,通过它来传递实例的属性和方法(也可以传类的属性和方法); 调用:只能由实例对象调用。 类方法 定义:使用装饰器@classmethod。第一个参数必须是当前类对象,该参数名一般约定为“cls”,通过它来传递类的属性和方法(不能
阅读全文
posted @ 2020-03-29 21:43 tangqiu
阅读(226)
评论(0)
推荐(0)
2020年3月25日
git ssh切换到https
摘要: 1、从ssh切换至https git remote set-url origin(远程仓库名称) https://email/username/ProjectName.git 2、从https切换至ssh git remote set-url origin git@email:username/Pr
阅读全文
posted @ 2020-03-25 15:21 tangqiu
阅读(2347)
评论(0)
推荐(0)
转载:flask蓝图的使用
摘要: https://blog.csdn.net/weixin_44141899/article/details/86498326 https://blog.csdn.net/weixin_41973615/article/details/82252501
阅读全文
posted @ 2020-03-25 14:00 tangqiu
阅读(132)
评论(0)
推荐(0)
python 的isdigit()
摘要: def is_isbn_or_key(word): isbn_or_key='key' ''' isdigit()方法检测字符串是否只由数字组成。 ''' if len(word)==13 and word.isdigit(): isbn_or_key='isbn' short_word=word.
阅读全文
posted @ 2020-03-25 13:53 tangqiu
阅读(338)
评论(0)
推荐(0)
Python 的format()
摘要: format()格式化输出 其实就是format()后面的内容,填入大括号中(可以按位置,或者按变量) '数字{1}{2}和{0}'.format("123",456,'789') >>>'数字456789和123' #可以通过添加关键字参数 '{name}{age}岁'.format(age=22
阅读全文
posted @ 2020-03-25 13:50 tangqiu
阅读(460)
评论(0)
推荐(0)
常用的Python知识,静态方法和类方法
摘要: 1、静态方法 import requests class Http: #类的静态方法,调用不需要创建对象,不需要使用self @staticmethod def get(url,return_json=True): r=requests.get(url) if r.status_code==200:
阅读全文
posted @ 2020-03-25 13:46 tangqiu
阅读(137)
评论(0)
推荐(0)
flask 蓝图
摘要: 1、目录结构 2、app/__init__.py from flask import Flask from app.api import api from app.web import web ''' 定义APP,注册蓝图 ''' def create_app(): app=Flask(__name
阅读全文
posted @ 2020-03-25 11:23 tangqiu
阅读(182)
评论(0)
推荐(0)
简单的flask 示例
摘要: 1、hello.py from flask import Flask app=Flask(__name__) @app.route('/hello') def hello(): return 'hello world' if __name__=='__main__': app.run(host='0
阅读全文
posted @ 2020-03-25 10:59 tangqiu
阅读(2492)
评论(0)
推荐(0)
pipenv的使用
摘要: 1、安装pipenv pip install pipenv 2、cd 切换到需要使用pipenv 的路径将project 和pipenv 绑定 pipenv install 3、绑定之后,可以安装packages pipenv install flask pipenv install request
阅读全文
posted @ 2020-03-25 10:43 tangqiu
阅读(218)
评论(0)
推荐(0)
下一页
公告