Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9219183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:03:11+00:00 2026-06-18T03:03:11+00:00

I’m currently using Komodo Edit in Windows 7, however, I have experienced this problem

  • 0

I’m currently using Komodo Edit in Windows 7, however, I have experienced this problem on my Mac with TextWrangler. For whatever reason I’m getting some kind of whitespace error which is a huge problem when I’m writing in Python. For example, everything appears to be properly tabbed, but Komodo is currently giving me an “Ambiguous whitespace” error

//How it appears in my editor
def SaveList(self, directory):
    templist = []
    templistbox2 = []
    for n,i in enumerate(self.listbox2.get(0,END)): 
       templistbox2.insert(n, re.sub(r'^[0-9]*[.]',"",str(i)))
    for filename in sorted(os.listdir(directory)):
        self.templist.insert(i, filename)
        print filename #whitespace error here

Considering I’ve experienced this with two different editors on both windows and Mac, I’m wondering if there’s some setting I don’t know about, or if I’m doing something wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:03:13+00:00Added an answer on June 18, 2026 at 3:03 am

    When I copy your code to a file, test.py, and run

    cat -A test.py
    

    I see

    //How it appears in my editor$
    def SaveList(self, directory):$
        templist = []$
        templistbox2 = []$
        for n,i in enumerate(self.listbox2.get(0,END)): $
           templistbox2.insert(n, re.sub(r'^[0-9]*[.]',"",str(i)))$
        for filename in sorted(os.listdir(directory)):$
            self.templist.insert(i, filename)$
    ^I    print filename #whitespace error here$
    

    which indicates there is a tab (represented by ^I) followed by four spaces on the last line.

    I’m not sure what the equivalent tool on Windows would be, but the Mac should have the cat -A command. It will show you where the tabs versus spaces are.


    There is a program called reindent.py which will convert tabs to spaces for you:

    reindent.py test.py
    

    On Unix there is also a unexpand command which converts spaces to tabs.


    Most Python programmers use spaces rather than tabs for indentation. Most of the Python code you find on the web will use spaces rather than tabs.

    Your editor may be adding tabs, but if you took a snippet of code from the web, your file may now contain both tabs and spaces.

    It is easiest to go with the flow and adopt the spaces-as-indentation convention, so you will not have to reformat other people’s code so much.

    By the way, adopting the spaces-as-indentation convention does not mean having to press SPACE 4 times for each indentation level. Your editor should have a configuration option which makes pressing TAB insert 4 spaces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I have been unable to fix a problem with Java Unicode and encoding. The
I have thousands of HTML files to process using Groovy/Java and I need to
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.