0

I am using Python and sublime text 3 on Macbook Air. When I use sublime text3 open the .py file, there are some annoying white rectangle around my codes and comments.

The rectangles around comments show:

block comment should start with '#'

The rectangles around the head of a function show:

too many blank lines

The rectangles around the keyword in python show:

unexpected spaces around keyword/parameter equals

The code is here

import pylab
#set line width
pylab.rcParams['lines.linewidth'] = 6
#set font size for titles 
pylab.rcParams['axes.titlesize'] = 20
#set font size for labels on axes
pylab.rcParams['axes.labelsize'] = 20
#set size of numbers on x-axis
pylab.rcParams['xtick.major.size'] = 5
#set size of numbers on y-axis
pylab.rcParams['ytick.major.size'] = 5

def findPayment(loan, r, m):
"""Assumes: loan and r are floats, m an int
Returns the monthly payment for a mortgage of size
loan at a monthly rate of r for m months"""
return loan*((r*(1+r)**m)/((1+r)**m - 1))

And the problem is like enter image description here

Jason
  • 73
  • 1
  • 1
  • 7
  • 2
    Yes, this is the PEP8 linter advising you that your code is not adhering to the style-guide expected. If your goal is to meet PEP8 standards, you should listen to those comments and fix what it says. You probably have SublimeLinter installed. Unless SublimeText 3 now includes its own? – idjaw Jul 22 '17 at 02:17
  • 1
    If you did install SublimeLinter, then read [this](https://stackoverflow.com/questions/10354857/sublimetext-encloses-lines-in-white-rectangles) – idjaw Jul 22 '17 at 02:20
  • 2
    Sublime has no linting support built in. This is definitely a user added package. – OdatNurd Jul 22 '17 at 02:36
  • 1
    @idjaw in my case, it seems that it is because I installed anaconda. Thanks so much! – Jason Jul 22 '17 at 02:52
  • 2
    You can see the errors or suggestions at the bottom, when you select the line, Its PEP8 suggestions, you can disable it by `shift`+`crtl`+`p` and select `Anaconda: Disable linting on this file` – Bijoy Jul 22 '17 at 03:36

0 Answers0