[英]How can I debug external python package in PyCharm
I have downloaded python package from the web (eg, github).我已经从 web(例如,github)下载了 python package。
The usage is via CLI, for example:用法是通过 CLI,例如:
python functionality.py opt1 opt2
Since I want to understand what is going on under the hood in functionality.py
I want to be able to debug it line by line.因为我想了解functionality.py
.py 中的幕后情况,所以我希望能够逐行调试它。 How can I achieve that using PyCharm?如何使用 PyCharm 实现这一目标?
Sorry for not writing a comment, but I don't have the right.很抱歉没有写评论,但我没有权利。
You could use the package in a simple script (import it).您可以在一个简单的脚本中使用 package(导入它)。 Afterwards, press CTRL+LEFT CLICK on the function/class that you have used in order to see the source code.然后,在您使用的函数/类上按 CTRL+LEFT CLICK 以查看源代码。 Now you can put breakpoints my clicking on the space near the line number现在你可以在我点击行号附近的空格处设置断点 . . The red point indicates that a breakpoint is put.红点表示放置了一个断点。 You can run your script in debug mode using the debugger from the menu up right (second icon) and see what's happening.您可以使用右上角菜单中的调试器(第二个图标)在调试模式下运行脚本并查看发生了什么。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.