1.設置斷點,而後debug
2.若是在運行中想修改變量,能夠直接在pycharm中修改 如將列表的 13改爲3,而後選中 Excuting Selection in console
3.再來debug就是用調整後的變量執行了
****************************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************************
一、打開你的工程,在菜單欄裏找到Run-->Edit Configurations
![](http://static.javashuo.com/static/loading.gif)
二、在打開的對話框裏邊選擇Python,點擊+號html
![](http://static.javashuo.com/static/loading.gif)
四、選擇Python數據庫
![](http://static.javashuo.com/static/loading.gif)
五、出現了一個新的項Unnamed,你能夠把它更名叫debug,好聽一點django
![](http://static.javashuo.com/static/loading.gif)
六、腳本選擇你網站的manage.py,腳本參數用runserver,跟你日常用命令行是同樣的,聰明的同窗應該已經發現了,也能夠配置migrate(數據庫同步)等等命令參數,來實現命令的快速運行,省的手敲了服務器
![](http://static.javashuo.com/static/loading.gif)
七、以後在菜單欄裏找到Run-->Debug'debug',並點擊網站
![](http://static.javashuo.com/static/loading.gif)
八、運行後,你能在Console中看到服務器已經運行起來了,有日誌打印命令行
![](http://static.javashuo.com/static/loading.gif)
九、以後在你的程序裏打斷點試試吧,當程序運行到你的斷點就會定住了,愉快的調試吧!debug