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

yipeiwu_com5年前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中的单行、多行、中文注释方法

Python中的单行、多行、中文注释方法

一、python单行注释符号(#) python中单行注释采用 #开头 示例:#this is a comment 二、批量、多行注释符号 多行注释是用三引号”' ”'包含的,例如:...

python模块之StringIO使用示例

StringIO经常被用来作为字符串的缓存,应为StringIO有个好处,他的有些接口和文件操作是一致的,也就是说用同样的代码,可以同时当成文件操作或者StringIO操作。比如: 复制...

基于Python中的yield表达式介绍

基于Python中的yield表达式介绍

python生成器 python中生成器是迭代器的一种,使用yield返回函数值。每次调用yield会暂停,而可以使用next()函数和send()函数可以恢复生成器。 这里可以参考Py...

python中元类用法实例

本文实例讲述了python中元类用法,分享给大家供大家参考。具体方法分析如下: 1.元类(metaclass)是用来创建类的类 2.type(object):返回一个对象的类型,与obj...

python实现简单socket通信的方法

本文实例讲述了python实现简单socket通信的方法。分享给大家供大家参考,具体如下: 刚刚开始接触python,实现了一个helloworld程序---关于udp协议的socket...