Python导入方法都有哪些,除import外,pythonimport,我看见别人的代码没有引入
Python导入方法都有哪些,除import外,pythonimport,我看见别人的代码没有引入
我看见别人的代码没有引入相关的库,但是仍然能够运行,不知道为啥
from user import *from django.template import Templatefrom decimal import Contextfrom models import ServiceCoredef Register(request): register_t = loader.get_template('core/_register.html') c = Context({"REQUEST":request.REQUEST}) return HttpResponse(register_t.render(c))
上面代码没有引入loader也没有HttpResponse,也能运行不知道为啥
因为没有执行这个函数。。在最下面添加一行 Register(your_arg)就会报错了。NameError: global name 'loader' is not defined
编橙之家文章,
相关内容
- 用python怎么不刷新网页而监控网页变化?,python监控
- python numba jit效率如何提高,numbajit,因为本人目前正在学
- 请问vmware如何从外部通过http访问内部的方法,vmware访问
- python语言为什么那么的参数函数和变量,python函数变量
- Python SDK安装遇到错误提示求助,pythonsdk,各位大牛们好
- Python2.6 pip安装gittle报错求解,python2.6gittle,python2.6 pi
- 需要用Python将编码转换成汉字求帮助,python汉字,请问,
- 关于python编辑器内提示的问题,python编辑器内提示,为什
- Python scrapy抓取淘宝数据可行吗,pythonscrapy,例如想抓取
- 这是一个关于判断浮点数的精度问题,求指导,点数精度
评论关闭