質問編集履歴

1

捕捉追加(スタックトレース??)

2017/06/22 12:56

投稿

violineer
violineer

スコア72

test CHANGED
File without changes
test CHANGED
@@ -63,3 +63,107 @@
63
63
  となってしまいます。他のcv2コマンドは受け付けています。どうなっているのでしょうか……??
64
64
 
65
65
  何度も再起動等試しました。
66
+
67
+
68
+
69
+ 捕捉:spyderを使用しています。
70
+
71
+ スタックトレースを見る方法がわからなかったのですが、これであっていますかね??
72
+
73
+ import pdb; pdb.set_trace()
74
+
75
+ をコードに書き加え、実行したら以下の通りにコンソールに表示されました。
76
+
77
+
78
+
79
+
80
+
81
+ ```python
82
+
83
+ import pdb; pdb.set_trace()
84
+
85
+ --Call--
86
+
87
+ > c:\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\ipython\core\displayhook.py(236)__call__()
88
+
89
+ 235
90
+
91
+ --> 236 def __call__(self, result=None):
92
+
93
+ 237 """Printing with history cache management.
94
+
95
+
96
+
97
+
98
+
99
+ ipdb> --Call--
100
+
101
+ > c:\winpython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\ipython\core\displayhook.py(236)__call__()
102
+
103
+ 235
104
+
105
+ --> 236 def __call__(self, result=None):
106
+
107
+ 237 """Printing with history cache management.
108
+
109
+
110
+
111
+
112
+
113
+ ipdb>
114
+
115
+ ```
116
+
117
+
118
+
119
+ 236周辺はこちらです
120
+
121
+ ```python
122
+
123
+ def finish_displayhook(self):
124
+
125
+ """Finish up all displayhook activities."""
126
+
127
+ io.stdout.write(self.shell.separate_out2)
128
+
129
+ io.stdout.flush()
130
+
131
+ 236
132
+
133
+ def __call__(self, result=None):
134
+
135
+ """Printing with history cache management.
136
+
137
+
138
+
139
+ This is invoked everytime the interpreter needs to print, and is
140
+
141
+ activated by setting the variable sys.displayhook to it.
142
+
143
+ """
144
+
145
+ self.check_for_underscore()
146
+
147
+ if result is not None and not self.quiet():
148
+
149
+ self.start_displayhook()
150
+
151
+ self.write_output_prompt()
152
+
153
+ format_dict, md_dict = self.compute_format_data(result)
154
+
155
+ self.update_user_ns(result)
156
+
157
+ self.fill_exec_result(result)
158
+
159
+ if format_dict:
160
+
161
+ self.write_format_data(format_dict, md_dict)
162
+
163
+ self.log_output(format_dict)
164
+
165
+ self.finish_displayhook()
166
+
167
+ コード
168
+
169
+ ```