最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is there any simple way to let PyCharm directly debug the current .py file in "Python" mode instead of &qu

programmeradmin3浏览0评论

I am using PyCharm 2024.2.4.

I want to debug my current .py file, for example,

if __name__ == "__main__":
    print("Hello World")
else:
    print(f"__name__=", {__name__})

However, PyCharm by default uses a configuration for "Python tests", not "Python". The problem is that __name__ in Python tests is the filename, not __main__.

I have to manually create a "Python" configuration for every python file I want to debug, which is annoying.

Is there any simple way to let PyCharm directly debug the current .py file in "Python" mode instead of "Python tests" mode?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论