Forums

Tabs instead of Spaces

I have a python script that I am trying to edit and run on PythonAnywhere. But the script uses tabs instead of spaces. When I try to edit the file, my inserted tabs (from hitting the tab key) seems to be converted to spaces, causing errors in my code.

I know that I can find and replace the tabs with spaces, but I need them to be tabs. This is a script that is meant to also run in pythonista on the ipad which needs tabs to be actual tabs.

Is there anyway to set it up so that the tab key actually inserts a tab?

In the editor you can use ctrl-, to bring up a little configuration window and use that to turn off "Use soft tabs"

However, when I change the Tab to be 2 spaces, instead of 4, it does not save it and when I reload my file it is back to 4

Yes, it currently works like that. We have a ticket for that, so I'm upvoting it for you.