lok*_*art 13 python django notepad++ indentation
我正在按照本书学习使用notepad ++的django,当我使用notepad ++为以下脚本键入函数时,会发生一些有趣的事情:
def current_datetime(request):
now = datetime.datetime.now()
html = "<html><body>It is now %s.</body></html>" % now
return HttpResponse(html)
Run Code Online (Sandbox Code Playgroud)
它给我一个这样的错误:
IndentationError at /time/
('unexpected indent', ('M:\\DjangoStack\\projects\\beta_01\\..\\beta_01\\hello_world\\views.py', 12, 1, '\thtml = "<html>"\n'))
Run Code Online (Sandbox Code Playgroud)
但是当我直接从书中粘贴它时,没关系.我想知道为什么,我应该在notepad ++中做一些设置吗?谢谢.
我用来4 space bars
在记事本++中创建缩进,我试过1 tab
,似乎问题是固定的
归档时间: |
|
查看次数: |
23807 次 |
最近记录: |