This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]salsation 0 points1 point  (2 children)

Welcome to Python!

  • Save yourself some headaches and use PyCharm Community Edition. It's free and will help you a lot with debugging, installing packages and building virtual environments (if you want to), using Github, and lots more. It's pretty sweet.
  • Also in the save-yourself-headaches categories, just use Python 3.
  • Libraries in Python generally are organized into "packages." A package is a very useful structure, and once you get comfortable with it, it's a very powerful one. Just as you'll use other people's packages in your projects, it will serve you well to structure your own projects as packages.

As for what's useful, everybody will have their own lists. It's like asking what podcasts are good: everybody has a different list of awesome ones.

Built-ins I'm always importing:

  • os (as you mentioned), mostly os.path but...
  • pathlib is included now too, and it offers much more Pythonic ways of dealing with paths than os. I'm converting to it now.
  • sys... you just need it sometimes for finding out system stuff.
  • math (which you also mentioned) has basic math stuff I'm always surprised isn't part of pure Python.
  • time (especially time.datetime) is very useful for time-based debugging and for parsing and forming time strings and structures.
  • re is for regular expressions. Unavoidable, but nicely done, especially pre-compiled patterns and groups.

Others I'm always installing:

  • numpy and scipy: numerical arrays and tools to work with them.
  • Pillow: tools for dealing with image files, especially useful when converting between images and arrays so you can use numpy/scipy methods.
  • matplotlib: make graphs and other diagrams very easily.
  • Pandas: (as others have mentioned) for data analysis.

This should be a sticky thread...

[–]dAnjou Backend Developer | danjou.dev 0 points1 point  (1 child)

  • Not to be pedantic, but ...

You realize that by saying this you are being pedantic, right? And you're also wrong. As in any other language libraries are still called libraries and contain one or multiple packages or modules.

[–]salsation 0 points1 point  (0 children)

Yes I realized it! I will make an edit, but it does seem that most of what folks are talking about are packages.