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

  • Home
  • SEARCH
  • 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 9200165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:42:17+00:00 2026-06-17T22:42:17+00:00

I have this really irritating problem that I do not quite understand in which

  • 0

I have this really irritating problem that I do not quite understand in which my python files are ruined (appear ruined??) when I open them in one text editor or another. Spaces disappear and with them the control blocks. Obviously this has something to do with how the whitespace is saved but I don’t fully understand it or know how to control it.

I edit the files on up to three computers in multiple editors, mostly kate, nano and vim. I thought that I had them all set to tab=4 spaces with autoindent for *.py but apparently it’s not working like that.

What do I need to do to insure my files behave consistently across text editors? Some explanation of what the problem is together with specific advice for the above editors would be greatly appreciated.

  • 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-17T22:42:18+00:00Added an answer on June 17, 2026 at 10:42 pm

    Use spaces, not tabs. Spaces are always interpreted as the same width, unlike tabs. PEP 8 (the python styleguide) recommends spaces over tabs, as does the Google Python styleguide.

    Thus, if you consistently use spaces only, your code will always be indented properly.

    You can check your python files for inconsistent tab usage by running the code with the -tt switch:

    python -tt yourscript.py
    

    Once you’ve cleaned up inconsistencies, use the Unix expand command to replace tabs with spaces:

    expand -t 4 yourscript.y
    

    where -t 4 instructs expand to replace tabs with 4 spaces.

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

Sidebar

Related Questions

This is a really irritating problem to have that springs from poor process, I
Ok I have this problem that I've never had before, it's really bugging me.
I have this situation that is really irritating me now. At random times with
i have this really weired js problem. in summary, i get a element not
I have this really complex animation that runs once and I can not use
I have a really irritating problem. This is the buffer structure i am using
I have this really crazy problem which I cant seem to tackle. I tried
hey guys having this really simple problem but cant seem to figure out have
I have read that you can do it, but would this really improve performance
This is really getting to me now.I have a form that loads when the

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.