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的代码是不行的

发布了8 篇原创文章 · 获赞 14 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/bz_xyz/article/details/83096595
今日推荐