Skip to content Skip to sidebar Skip to footer

Taberror: Inconsistent Use Of Tabs And Spaces In Indentation - Integration Mailchimp Django

I have just integrated Mailchimp to my Django Project using Ajax. The email address field is working properly and I'm able to get the email in both my Mailchimp list and my databas

Solution 1:

According to the python documentation, python cannot mix tabs and spaces for indentation, and according to PEP-8, four spaces should be used for each indent level. When I attempt this it is true:

>>> for i inrange(20):
    'indent with tabs''indent with spaces'

SyntaxError: inconsistent use of tabs and spaces in indentation

If you have a python IDE, not just writing them in, say Notepad or TextEdit, it should convert each tab to four spaces, or (not recommended because of PEP-8) every 4 four spaces to one tab.

Edit: you can use the Ctrl+H combination to find/replace each tab with 4 spaces (this will not affect your actual code; your tabs in strings should be '\t')

Post a Comment for "Taberror: Inconsistent Use Of Tabs And Spaces In Indentation - Integration Mailchimp Django"