sublime text 运行python代码,图形无显示

sublime text 2 中运行:

import matplotlib.pyplot as plt
plt.plot([1,1,1,1])
plt.show() 

图片显示不出来


解决方案:

进入:Preferences→Browse Packages, 打开exec.py文件,在第26行中有:

        startupinfo = None
        if os.name == "nt":
            startupinfo = subprocess.STARTUPINFO()
            #startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW

最后一行是自己注释的,只要注释了这一行就能出现图形了。


参考:http://ptomato.wordpress.com/2012/02/09/geek-tip-running-python-guis-in-sublime-text-2/



你可能感兴趣的:(sublime text 运行python代码,图形无显示)