Fra*_*eng 5 python debugging pdb
当我调试c代码时,我总是使用'gdb a.out < test'来重定向标准输入流。但当我真正做到的时候pdb,我发现它不起作用。在 pdb 帮助文档中搜索后,我仍然找不到与此问题相关的内容。
编辑:我发布我的代码。你能帮我将其更改为以最小的修改从文件中读取吗?谢谢。
cnt = int(raw_input())
paths = []
for cs in range(cnt):
action, path = map(None, (raw_input() + " dumb").split(" ", 1))
if (action == "pwd"):
print "/",
for p in paths:
print p + "/",
print
else:
strs = path.split("/")
for i in range(len(strs)):
p = strs[i]
if (p == ""):
continue
if (p == ".."):
paths.pop()
else:
paths.append(p)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2898 次 |
| 最近记录: |