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

0

u/[deleted] Nov 27 '20

[deleted]

8

u/fisfia Nov 27 '20

Fortunately not :) No, I just added up all the exercises in one document to be able to search for stuff I already solved, and to see my progress. So to be clear (not a stupid question at all!): it's when putting all lines from every exercises in the entire book thus far in a single file of flow. This file will not really be runnable so to speak. It's just my "documentation". I do the challenges in separate files to be able to try if they work.

4

u/vectorpropio Nov 27 '20

Now you can make a python script that transverse a directory and print filenames and lines of code, and total line couture at the end.

Also learn to use other tools. If you are in Linux read about grep,wc and (bu this one is more trickier) find.

2

u/fisfia Nov 27 '20

Thanks for the great suggestions!! I'll continue my way through the book first then I'll get back to you when I reached the knowledge required to do what you suggest :D

3

u/vectorpropio Nov 27 '20

Oh, I didn't read that book, so i was off in my appreciation.

I'm not sure if the book touch pathlib. If not, after you will read about file and directories go everywhere to read how to use that library. It greatly simplify work with paths and blur the difference between windows and Linux

2

u/fisfia Nov 27 '20

Sounds cool! I'm looking forward to knowing all the things your talking about ;) Edit: And I'll look up pathlib. Used it yesterday, but just copy pasted hehe an example line into what I was doing. I'll check it out for reals!