The tabs mixed with spaces doesn't seem to be the problem.
I do believe it is. I think what is happening is your pushing either tab or spaces to the next line. To completely ensure to get rid of all tabs, convert the whole file to tabs using spaces. When i first started on python i always used tabs to indent, and it caused a lot of problems identical to the one you are having. Now, by habit, the first thing i do when i grab a piece of code off the internet is, check for tab/space mixing and sometimes just convert it all to spaces anyways just to ensure to not have the problem you are having.
(No other python editors have run module, so that's why I sometimes use IDLE)
just because there is not a GUI button that says "Run Module" does not mean other IDE's do not have such capabilities. Every IDE has a way to quickly execute python and the file. Again i am going to use geany for an example... In Geany The equivalent to IDLE's run module is Build -> Execute. However Execute is just a command line/terminal command. under the hood it just executes
- Code: Select all
, in which you can modify the command and save it. I would suggest executing from your command line for awhile to figure out what happens under the hood of your IDE's. After that point, then use IDE's and you will know how to modify/ or even find the IDE's execute button