I am using Sublime Text 3 in Ubuntu. The default Python is python2
which Sublime uses when I build program using Ctrl+B.
I am trying to run code as,
print(f"Player {row[0]} Vertically =")
but it gives error as follows because code is run with default Python
File "/home/gd/Desktop/python/python-revision/pp_13_iterators_iterables.py", line 41
print(f"Player {row[0]} Vertically =")
^
SyntaxError: invalid syntax
[Finished in 0.0s with exit code 1]
[shell_cmd: python -u "/home/gd/Desktop/python/python-revision/pp_13_iterators_iterables.py"]
[dir: /home/gd/Desktop/python/python-revision]
However, when I run same program from terminal, using python3
it works as expected.
$ python3 pp_13_iterators_iterables.py
[1, 2, 1]
[2, 0, 1]
[1, 2, 1]
Vertically
Player 1 Vertically =
How can I change default build environment of Sublime Text to Python 3 and build it using shortcut as Ctrl+B?
I tried using alias as
alias python="/usr/bin/python3.6"
but it didn't work and gave same error as previous.