If you are using an OS like Linux,BSD or OSX these tips may help you.
If you are using vim as your text editor add these lines to .vimrc in you home folder (~/.vimrc)
If the file does not exist simple create it.
This sets your tab length to 4 and converts the tab into spaces. Python will accepts tabs or spaces as indentation but not a mixture of both.
These settings will ensure that your indents are always 4 spaces. If you open a file that already has tabs for indents then type :retab to change the tabs to spaces.
Add #!/usr/bin/python (path to the python binary) to the top of you python scripts and you will be able to run them directly from the shell. (run which python from the shell to get the path of the binary if it is in your systems search path)
Next make sure the file is executable by running chmod +x sudoku and finally to run the script ./sudoku
asked 15 Mar '12, 10:04
A more cross platform way of working with that is to use
A lot of editors can convert tabs to spaces, as to a good number of IDE's since it is better to use spaces than tabs. It's a setting that should be looked for, not just in vim.
answered 15 Mar '12, 10:26