Re: Python Program Development - Indentations Issue
notepad will put in tabs for indentations long enough that tabs can be used. generally this is 8 positions. the python world prefers spaces instead of tabs because tabs make the indentation harder to work with, such as moving a block of code over because of things like a "for" clause or "if" clause being added or removed. i am not surprised that it is now necessary in python. the Windows version of python may still allow tabs.
there is a command called "expand" in Ubuntu which converts tabs to the proper number of spaces. do "man expand" in a command line terminal to read more about it. it can read filenames given to it as arguments but always writes the file to standard output, so the way to use it (after the file is on Ubuntu) is:
Code:
expand mything.py > mything.tmp
mv mything.tmp mything.py
Last edited by Skaperen; May 22nd, 2018 at 05:09 AM.
Mask wearer, Social distancer, System Administrator, Programmer, Linux advocate, Command Line user, Ham radio operator (KA9WGN/8, tech), Photographer (hobby), occasional tweetXer
Bookmarks