Archivist
Archivist copied to clipboard
How to fix this error?
\Desktop\keylogger>python logger.py File "logger.py", line 154 risk_score += 5 ^ TabError: inconsistent use of tabs and spaces in indentation
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.
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
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.