01/10/2018, 12:11

Làm sao để lựa chọn trình dịch Python 2/3 khi build file trên sublime text

Nếu mình có 2 bản python 2 và python 3 thì sau khi code xong bấm Ctrl+B thì nó sẽ chạy trên python nào và làm sao để lựa chọn? mong mọi người giúp đỡ

HK boy viết 14:20 ngày 01/10/2018

Bạn thường hay code Python 2 hay Python 3? Nếu prefer Python 3 thì bạn thử đọc link này:

gist.github.com

https://gist.github.com/zaemiel/4fbd8b5125fda7a140be

How to link Sublime Text Build system to Python 3
1. Go to Sublime Text to: Tools -> Build System -> New Build System 
and put the next lines:

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

Then save it with a meaningful name like: python3.sublime-build
This file has been truncated. show original

Chi Vien Nguyen viết 14:24 ngày 01/10/2018

ok, cảm ơn bạn nhiều, mình làm đc rồi

Bài liên quan
0