Python-编程小技巧

1.Pycharm的自动提示

from django.core.handlers.wsgi import WSGIRequest
# pycharm的自动提示
request=request  # type: WSGIRequest

2.如果encode和decode记混了,可以用下面的方式

1 方式一: 
	a='sdasdf' # type str
    a.提示
2 方式二:这种方式就不需要记encode和decode了
	ss = str(request.body,encoding = 'utf-8')
    ss_bytes = bytes('字符串变量',encoding = 'utf-8')
posted @ 2020-12-01 09:35  王寄鱼  阅读(53)  评论(0编辑  收藏  举报