Sublime Text Python Tips
[IMG:Python 3 print autocompletion (721kB)] [SHOW ALL]
Working with both Python 3 and Python 2.7 in Sublime? Can't make yourself used to type print
with brackets? Put this simple snippet in your Sublime Text User Package directory. It will autocomplete print
statement with brackets.
Bonus tip for Linux users. Tired to switch build system from Python
to Python 3
and back? Just want to Sublime Text use shebang/hashbang when running Build
(F7) command? I.e:
- If your file starts with
#!/usr/bin/python3
use Python3 - If your file starts with
#!/usr/bin/python
use Python - If your file starts with
#!/usr/bin/env python
use default Python version - If your file starts with
#!/bin/bash
orperl
e.t.c., run file defined app..
Put this simple build system in your Sublime Text User Package directory, then select Tools → Build System → Run
, and you will have universal runner based on file first line.