当我调试 c 代码时,我总是使用 'gdb a.out 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) 最佳答案 更改您的程序以从命令行指定的文件中读取测试数据。关于python - 调试python时如何重定向标准输入?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11098628/
10-12 01:40