python3.4安装配置sublime

1.安装python3.4

2.环境变量path中添加python3.4绝对路径,pthon3.4下面scripts的绝对路径,比如我的是:
C:\Python34;C:\Python34\Scripts
python3.4安装配置sublime_第1张图片
3.cmd输入python并回车查看安装是否成功
python3.4安装配置sublime_第2张图片
4.cmd输入pip install selenuim去安装selenium,pip show selenium 查看安装结果

5.打开sublime,ctrl+`调出输入框,输入下面这段

import urllib2,os,hashlib; h = ‘6f4c264a24d933ce70df5dedcf1dcaee’ + ‘ebe013ee18cced0ef93d5f746d80ef60’; pf = ‘Package Control.sublime-package’; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler()) ); by = urllib2.urlopen( ‘http://packagecontrol.io/’ + pf.replace(’ ', ‘%20’)).read(); dh = hashlib.sha256(by).hexdigest(); open( os.path.join( ipp, pf), ‘wb’ ).write(by) if dh == h else None; print(‘Error validating download (got %s instead of %s), please try manual install’ % (dh, h) if dh != h else ‘Please restart Sublime Text to finish installation’)

回车,重启sublime,preferences查看是否有package-control和setting
python3.4安装配置sublime_第3张图片
6.sublime-preferences-Browse pakages打开文件夹,找到python,找到Python.sublime-build
修改内容为:
{ "cmd": ["python", "-u", "$file"], "path":"C:/Python34", "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)", "selector": "source.python", "encoding": "gbk" }
path为python根目录

7.sublime-preferences-Browse pakages打开文件夹,找到Default文件夹,找到exec.py文件,打开该文件,注释第44-45行。

8.chromedriver.exe驱动安装包分别放在chrome的Application目录下和python的根目录下

9.以上操作为安装python selenium,安装编辑器sublime的package插件安装包(后续很多插件需要依赖他),sublime的python环境搭建,以及浏览器驱动放置,操作完毕可在sublime快捷键ctrl+B运行带selenium模块的python文件,调用浏览器驱动进行简单的浏览器操作

你可能感兴趣的:(测试)