1. 程式人生 > >記錄一次pycharm中,引入其他類可用,下面總是有波浪線,而且Ctrl+b 無法檢視類函式的原始碼

記錄一次pycharm中,引入其他類可用,下面總是有波浪線,而且Ctrl+b 無法檢視類函式的原始碼

    最近在玩python,發現引入其他的函式們總是有波浪線,但是能夠使用,crtl+b卻無法看到,非常尷尬,然後查看了原因,記錄如下:

      This inspection detects names that should resolve but don'(ctrl+f1)t. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items.

     解決的方法如下:   

     在pycharm中設定source路徑

    file–setting(或者ctrl+alt+s)–project structure

    將放package的資料夾設定為source,這樣import的模組類等,就是通過這些source資料夾作為根路徑來查詢,也就是在這些source資料夾中查詢import的東西。 

 


&n