最新消息:20210917 已从crifan.com换到crifan.org

【教程】把Sublime Text 2用作Python的IDE去实现Python的开发

Python IDE crifan 5309浏览 0评论

【背景】

之前已经介绍过了Sublime了:

【crifan推荐】一款相对不错的文本编辑器:Sublime Text 2

然后也介绍过了Python的各种IDE了:

【整理】各种Python的IDE(集成开发环境)的总结和对比

其中提到了Sublime。

现在就去试试,如何用Sublime去开发Python。

【折腾过程】

1.把Sublime作为Python的IDE,包括这里提到的,和其他所需要的功能,包括但不限于:

 

2.专门在Sublime Text 2,写了Python测试代码,如下:

#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Function:
【教程】把Sublime Text 2用作Python的IDE去实现Python的开发
【教程】把Sublime Text 2用作Python的IDE去实现Python的开发
Author: Crifan Li Version: 2013-02-01 Contact: admin at crifan dot com """ def sublimeText2IdeDemo(): """ Demo how to use sublime text 2 as Python IDE also try to support: input parameter autocomplete """ print "Demo print in Sublime Text 2"; inputVal = raw_input("Now in sublime text 2, please input parameter:"); print "Your inputed parameter is ",inputVal; if __name__ == "__main__": sublimeText2IdeDemo();

然后去运行python代码,结果出错“The system cannot find the file specified”,详见:

【已解决】Sublime Text 2中运行Python程序出错:The system cannot find the file specified

3.解决了找不到python的问题后,又出现下面错误:

【已解决】Sublime中运行带input或raw_input的Python代码出错:EOFError: EOF when reading a line

4.暂时,只是用SublimeREPL暂时解决了,支持参数输入的问题,虽然不是很好用。

关于其他的功能特点,还是有空再去试吧。

不过,也仅仅是折腾玩玩,Sublime,还是不适合开发Python,详见上面的帖子。

转载请注明:在路上 » 【教程】把Sublime Text 2用作Python的IDE去实现Python的开发

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (2)

  1. 不错,sublime相当好用
    龙龙FRED10年前 (2014-01-26)回复
    • sublime text 3 配上anaconda就是python开发神器了
      kim kong10年前 (2014-04-27)回复
99 queries in 0.184 seconds, using 23.32MB memory