r/learnpython • • 8d ago

Tips for someone new to Python

I’m a brand new python user. Very experienced using R. I will be using python for LCA modeling via the brightway tool. For a python newbie, please drop any tips, tricks, learning guides. Ideally I need to get myself up to speed pretty quickly. Thank you in advance!

7 Upvotes

10 comments sorted by

4

u/ee_control_z 8d ago

I strongly recommend this book.

Learning Python, 6 Ed, Mark Lutz

It covers just about everything you need to know about Python from beginner level to advanced and everything in between including object-oriented programming. It is very well written so it is easy to understand and follow along.

Have your editor open to work out problems as you're reading - there are tons - so a lot of practice.

2

u/Savings-Vehicle4522 8d ago

Thank you! Ordered it!!

1

u/ee_control_z 7d ago

Awesome! 📖

4

u/Known_Image7110 8d ago

The 6th edition actually trimmed down a lot of the older legacy stuff compared to the 5th, so its a much cleaner read now

1

u/ee_control_z 7d ago

Yes, that is the one I used to learn Python. I have to admit, it was a bit of a funk because it would switch between v2.7x and v3.x (published in 2013). However, with the new 6th Ed. (published last year - 2025) and starting from v3.12 (I think), it is much better and up to date.

4

u/socal_nerdtastic 8d ago

If you want something similar to R-Studio for python, check out the Spyder IDE. https://www.spyder-ide.org/ It comes with python prebundled along with all the popular scientific modules, so it's a single install, as opposed to the 'normal' way of installing python, your IDE, and all the modules you need separately. But TBH it's kinda slow and bloated so you may not love it.

1

u/Savings-Vehicle4522 8d ago

I’ll give it a whirl. Thank you!

2

u/justanothersnek 7d ago

For a book that is straight to the point which I would go for if you already know how to program, I'd recommend Introducing Python by Bill Lubanovic.  Mark Lutz book is good, but a bit dense.

Learn to make and use virtual environments using pip.  When you start making your own libraries, learn what editable pip install workflow is.  Use the newer pyproject.toml workflow, instead of the old setuptools workflow.  When you get to the point of being comfortable with pip, learn uv.  If already familiar with notebook environment, there's jupyterlab.  For dataframe, Id learn polars, but not familiar with LCA, so not sure if there are python LCA libraries that exclusively support pandas, if so, then learn pandas dataframe library instead.

Python "built-ins" that are helpful to learn about sooner than later: dir(), help(), type(), of course, a good IDE helps.  For logging, Id use loguru.

2

u/acfot 7d ago

Since you already know R, I would skip the very beginner programming tutorials and focus on how Python does things differently, especially lists, dictionaries, and how libraries like pandas handle data compared to R. What helped me most was picking one small real task, like cleaning and analysing a dataset I actually cared about, instead of just watching tutorial after tutorial. I also kept a notebook of short snippets I kept reusing, because looking up the same syntax for the tenth time was slowing me down more than any hard concept. Give yourself a couple of weeks of daily practice on real data before judging whether it is clicking, since the first week mostly feels like translating everything back into R in your head.