1. 程式人生 > >Sublime Text3執行python時,顯示不出影象

Sublime Text3執行python時,顯示不出影象

版本:python3 解決方法:

  1. 找到exec.py檔案 路徑: 我的是:…\Sublime Text 3\Packages\Default C:\Users\apple\AppData\Roaming\Sublime Text 3\Packages\Default
  2. 用Sublime Text3開啟
  3. 此處:
        # Hide the console window on Windows
        startupinfo = None
        if os.name == "nt":
            startupinfo = subprocess.STARTUPINFO()
            startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW

將最後一行註釋掉:

        # Hide the console window on Windows
        startupinfo = None
        if os.name == "nt":
            startupinfo = subprocess.STARTUPINFO()
            #startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW

注:使用matplotlib顯示時,要加一句plt.show(),照搬jupyter notebook的程式碼是不行的