Python中文
首页
教程
问答
标签
搜索
登录
注册
为什么我会得到“IndentationError:expected an indented block”?
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<pre><code>if len(trashed_files) == 0 : print "No files trashed from current dir ('%s')" % os.path.realpath(os.curdir) else : index=raw_input("What file to restore [0..%d]: " % (len(trashed_files)-1)) if index == "*" : for tfile in trashed_files : try: tfile.restore() except IOError, e: import sys print >> sys.stderr, str(e) sys.exit(1) elif index == "" : print "Exiting" else : index = int(index) try: trashed_files[index].restore() except IOError, e: import sys print >> sys.stderr, str(e) sys.exit(1) </code></pre> <p>我得到:</p> <pre><code> elif index == "" : ^ IndentationError: expected an indented block </code></pre>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>如错误消息所示,您有一个缩进错误。这可能是由标签和空格的混合造成的。</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
plt.savefig不会覆盖现有文件
1 回答
plt.savefig不保存图像
1 回答
plt.savefig在jupyter笔记本中不起作用
8 回答
plt.savefig在从另一个fi调用时停止工作
3 回答
plt.savefig在调用plt.show之前保存空数字
2 回答
plt.save不创建png文件
8 回答
plt.scatter overlay分类数据帧列
8 回答
Plt.Scatter:如何添加title、xlabel和ylab
9 回答
plt.scatter()绘图与Matplotlib中的plt.plot()绘图类似
2 回答
plt.scatter错误'NoneType'对象在成功运行后没有属性'sqrt'
2 回答
plt.set_title()中的标题字符串有误
9 回答
plt.show()
10 回答
plt.show()不在Jupyter笔记本上渲染任何内容
10 回答
plt.show()不打印plt.plot only plt.scatter
1 回答
plt.show()不显示三维散射图像
8 回答
plt.show()不显示任何内容
9 回答
plt.show()不显示数据,而是保留它供下一个图表使用(spyder)
2 回答
plt.show()使终端挂起
1 回答
plt.show()无法使用此代码
10 回答
plt.show()没有打开新的图形风
4 回答