Search code examples
pythonpython-3.xopen-source

Python sample project (as guide) suggestions for beginner


everyone, I am new in python. I am working on a python project and day by day my script is getting bigger and bigger. Now I have written up to 1000 lines of code in the single script. so it is looking messy and even it is hard to find some functions in my script.

I already have read Hitchhiker's guide and pepe8, but it would be more understandable if I will use one good python written python project as a guide or reference.

please suggest me some good project(for a beginner), which I can use to structure my script and my whole project. I am not a professional programmer but I want to be one.


Solution

  • I think that there are some ways to start to improve your scripts, and your habits:

    First, build a entry point to your scripts and become them in python modules as splited as you can to be easy reuse in the future, maybe a lot of your scripts share similar code.

    Resources:

    For another hand you maybe must start to test your code using Python's built-in unittest framework (the easiest).

    At at the end as you say you need to start to write code using the standards, and I think that the best way is using some pylint in your prefer editor to do not forget the most important as the correct syntax, blank lines, docs, var names, etc. There are a lot of resources about this, you know.

    I think is enough for a beginner.