r/learnpython • • Nov 27 '20

Milestone - 1,000 lines of code - TU r/learnpython!

Hi friends,

Just wanted to tell you all that I reached my first 1,000 lines of Python code (wanted to show a pic, but not allowed). I'm going through the book Python Crash Course, 2nd edition and doing all the exercises and some of the examples. Strongly recommend this resource, as so many others already have done. Also, I want to say a huge thank you to this community! I wouldn't have come this far without you <3

333 Upvotes

49 comments sorted by

View all comments

2

u/lolslim 🐍Telegram🤖 Nov 27 '20

Congrats OP,

Word of warning, you either get in the habit of spaces or tabs, and stick with it. Biggest project I have ever done was a telegram bot, I used spaces originally, but started to favor tabs, and went to tabs only, in 15 files, I still have a bunch of functions using spaces still since I never had to touch them to make changes.

Before I knew I can convert whitespace to tabs in atom IDE, I would use tabs inside a function that were all spaces, and got inconsistent spacing errors, it was a annoyance to say the least.

1

u/[deleted] Nov 28 '20

easy fix, put this in your .vimrc:

set expandtab tabstop=4 shiftwidth=4

Then, when your in the file you want too convert too spaces, just.

:retab

And it will automatically replace every tab with 4 spaces.

2

u/lolslim 🐍Telegram🤖 Nov 28 '20

Just going to save this post...