SublimeText 2编译python出错的解决方法(The system cannot find the file specified)

yipeiwu_com6年前Python基础

[Error 2] The system cannot find the file specified

解决方法:
1.环境变量path添加:
C:\Python32\Tools\Scripts;D:\Python32;D:\Program Files\Sublime Text2;
2.Python.sublime-build内容修改
原内容:

复制代码 代码如下:

{
     "cmd": ["python", "-u", "$file"],
     "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
     "selector": "source.python"
 }

修改为(路径为安装文件夹):

复制代码 代码如下:

{
 "cmd": ["C:/Python26/python.exe", "-u", "$file"],
 "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
 "selector": "source.python"
}

相关文章

将python依赖包打包成window下可执行文件bat方式

1、 打开一个记事本,将需要安装的第三方python依赖包写入文件,比如:需要安装urllib3、flask、bs4三个python库(替换成你想要安装的库,每个库之间用空格隔开),输入...

python绘制简单折线图代码示例

python绘制简单折线图代码示例

1.画最简单的直线图 代码如下: import numpy as np import matplotlib.pyplot as plt x=[0,1] y=[0,1] p...

Python 私有函数的实例详解

Python 私有函数的实例详解 与大多数语言一样,Python 也有私有的概念: • 私有函数不可以从它们的模块外面被调用 • 私有类方法不能够从它们的类外面...

python 使用opencv 把视频分割成图片示例

我就废话不多说了,直接上代码吧! #--coding:utf-8-- import cv2 #图像路径名字错误不提示 im=cv2.imread("timg.jpg",cv2...

对Python中9种生成新对象的方法总结

先定义一个类: class Point: def __init__(self, x, y): self.x = x self.y = y 下面我们使用9种方法来生...