在 PyDev 调试视图中命名线程
PyDev 的调试视图显示了线程,但它们的名称很神秘:
有没有办法从内部命名这些线程python代码?
PyDev's debug view shows the threads, however their names are cryptic:
Is there a way to name these threads from within the python code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来 PyDev 中显示的名称是默认分配的名称。
要解决此问题,您可以在创建线程时为其指定名称:
或者稍后只需设置 name 属性即可:
It looks like the names being displayed in PyDev are the ones assigned by default.
To fix that you can give a name to the thread when it's created:
or, later, just by setting the name attribute:
尝试使用 getName/setName API 或设置 name 线程上的属性。或者您可以在创建线程时设置名称。
Try using the getName/setName API or setting name attribute on a thread. Or you can set name when the thread is created.