The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Python FAQ. How do I keep editors from inserting tabs into my Python source?
By Guest on 7th November 2022 07:19:29 AM | Syntax: PYTHON | Views: 192



New Paste New paste | Download Paste Download | Toggle Line Numbers Show/Hide line no. | Copy Paste Copy text to clipboard
  1. How do I keep editors from inserting tabs into my Python source?
  2. ================================================================
  3.  
  4. The FAQ does not recommend using tabs, and the Python style guide,
  5. **PEP 8**, recommends 4 spaces for distributed Python code; this is
  6. also the Emacs python-mode default.
  7.  
  8. Under any editor, mixing tabs and spaces is a bad idea.  MSVC is no
  9. different in this respect, and is easily configured to use spaces:
  10. Take Tools ‣ Options ‣ Tabs, and for file type "Default" set "Tab
  11. size" and "Indent size" to 4, and select the "Insert spaces" radio
  12. button.
  13.  
  14. Python raises "IndentationError" or "TabError" if mixed tabs and
  15. spaces are causing problems in leading whitespace. You may also run
  16. the "tabnanny" module to check a directory tree in batch mode.
  17.  
  18.  
  19. Tabs vs Spaces in Python code:
  20. https://www.youtube.com/watch?v=wyegDSxBy6E
  21.  
  22. Should you use TABS or SPACES for indentation in Python?
  23. https://www.youtube.com/watch?v=hCLf6cNYnCk
















Python software and documentation are licensed under the PSF License Agreement.
Starting with Python 3.8.6, examples, recipes, and other code in the documentation are dual licensed under the PSF License Agreement and the Zero-Clause BSD license.
Some software incorporated into Python is under different licenses. The licenses are listed with code falling under that license. See Licenses and Acknowledgements for Incorporated Software for an incomplete list of these licenses.

Python and it's documentation is:
Copyright © 2001-2022 Python Software Foundation. All rights reserved.
Copyright © 2000 BeOpen.com. All rights reserved.
Copyright © 1995-2000 Corporation for National Research Initiatives. All rights reserved.
Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved.

See History and License for complete license and permissions information:
https://docs.python.org/3/license.html#psf-license
  • Recent Pastes