如何在Sublime 2 REPL Mac中运行Python 3 [英] How to run Python 3 in Sublime 2 REPL Mac

查看:108
本文介绍了如何在Sublime 2 REPL Mac中运行Python 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的问题,我已经安装了sublime 2和sublime repl插件,它们都工作正常,我唯一需要做的就是更改在内置控制台的sublimerepl中运行的python版本.我的意思是,我有python 2.7.5(预安装了maveriks),在sublime中运行良好(通过sublimerepl),并且我已经通过安装程序从python.org,python 3.3.3安装了,我需要使用它,我想在sublimerepl控制台上运行此版本的python,但我不知道如何.

My question is the following, I have sublime 2 and sublime repl plugin installed all working fine, the only thing i need is to change the version of python that is running on the sublimerepl built in console. What I mean is, I have python 2.7.5 (which is pre installed with maveriks) running fine in sublime (via sublimerepl), and I have installed via the installer from python.org, python 3.3.3 , that I need to use, I want to run this version of python on the sublimerepl console but I don't know how.

我知道有一些崇高的选择,但是没有一个像崇高的那么漂亮.

I know that there are alternatives to sublime but none of those are so beautiful as sublime is.

有人可以帮我吗?我在互联网上搜索了所有内容,但找不到任何有用的信息.

Can someone help me with this ? I've searched for all over the internet and couldn't find anything helpful.

如果我使用终端python 3.3.3正常工作(终端>'python3'),我知道这是可能的,因为我的一个朋友使它正常工作,并且我像他一样安装了我的,但是我的却无法正常工作

Btw if I use terminal python 3.3.3 is working fine (Terminal>'python3'), I know this is possible beacause a friend of mine got it working and I have installed mine like he did, but mine is not working.

推荐答案

@poke的答案很好,但是有我认为我会自己输入答案以纠正一些细节,因为这些注释太长了,无法发表评论.首先,.sublime-menu项应命名为Packages/User/SublimeREPL/config/Python/Main.sublime-menu(将文件命名为其他名称不会将其集成到菜单系统中,它必须为Main.sublime-menu AFAIK).另外,对于您的系统,您可能应该将"cmd"行更改为指向/Library/Frameworks/Python.framework/Versions/3.3/bin/python3,这是python.org安装所在的位置.因此,例如,在显示

@poke's answer is good, but there are a few details to correct that I figured I'd just put in my own answer as they're too long for comments. First, the .sublime-menu entry should be named Packages/User/SublimeREPL/config/Python/Main.sublime-menu (naming the file something else won't integrate it into the menu system, it has to be Main.sublime-menu AFAIK). Also, for your system, you should probably change the "cmd" lines to point to /Library/Frameworks/Python.framework/Versions/3.3/bin/python3, which is where the python.org installation is located. So, for example, where it says

"cmd": ["python", "-i", "-u"],

将其更改为

"cmd": ["/Library/Frameworks/Python.framework/Versions/3.3/bin/python3", "-i", "-u"],

祝你好运!

这篇关于如何在Sublime 2 REPL Mac中运行Python 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆