HOW TO use Pycharm to debug python script?

后端 未结 4 1761
不思量自难忘°
不思量自难忘° 2020-12-15 18:14

I\'m trying to use pycharm. I can write code and run it. However, I do not know how to to debug the code. When I click the debug button, I get something similar to the belo

4条回答
  •  离开以前
    2020-12-15 19:06

    Take a look at Run -> Edit Configuration dialog where you should click on Add New Configuration ([+] icon at the left top corner). Then you need to choose project type (probably Python in your case), specify your script (.py) file, parameters, Python interpreter to use etc. Once configuration is selected, you should be able to just run your application in debugger.

    Refer to Debugging section in on-line help for more information.

    HelloWorld code:

    def main():
        print "Hello World"
    
    if __name__ == "__main__":
        main()
    

提交回复
热议问题