user8588509
user8588509

Reputation:

How can I do check syntax error of python in gvim in unix with python3.5?

I use with gvim and has auto checking python syntax. but it defines to python2.7. I want to change it to python3.5. How can I do it ? I use pylint or pylink

Upvotes: 1

Views: 85

Answers (1)

M B
M B

Reputation: 61

Look at this solution.

Specifically for your problem I would change the pylint executable in /usr/local/bin/pylint to use python3,

Just replace #!/usr/bin/python2 with #!/usr/bin/python3

So the file contents should look something like this:

#!/usr/bin/python3

# -*- coding: utf-8 -*-
import re
import sys

from pylint import run_pylint

if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(run_pylint())

Upvotes: 1

Related Questions