Archivist icon indicating copy to clipboard operation
Archivist copied to clipboard

How to fix this error?

Open somenormalguy7 opened this issue 6 years ago • 3 comments
trafficstars

\Desktop\keylogger>python logger.py File "logger.py", line 154 risk_score += 5 ^ TabError: inconsistent use of tabs and spaces in indentation

somenormalguy7 avatar Aug 22 '19 15:08 somenormalguy7

Yeah that probably happened when i committed the code to the repo. If you have your Text Editor or IDE handy and you open the source in there, you probably have an option where you can select the type of indentation and the width of them for the entire file.

Do that, save, and check if it's resolved.

NullArray avatar Sep 03 '19 12:09 NullArray

Hi , I guess you have mixed tabs & spaces while writing Python code,there should be consistent eiether space or tabs for each looping structure you write,try to format using visual studio it will be helpful

Vinothini10 avatar Oct 09 '19 08:10 Vinothini10

Hi , I guess you have mixed tabs & spaces while writing Python code,there should be consistent eiether space or tabs for each looping structure you write,try to format using visual studio it will be helpful

Yeah i definitely should. In general though, i code most of my scripts in Geany. I have VS Code for Linux but i tend to only use it for cross platform development when working with .NET Core and related langs, for instance.

Usually with Geany i simply select all the code and run an operation that's usually effective at transforming the indentation into one type either spaces or tabs.

NullArray avatar Nov 06 '19 00:11 NullArray