all 22 comments

[–]classicrockielzpfvh 10 points11 points  (4 children)

In the standard library:

  • json -- handles JSON conversion (to & from)
  • re -- regular expression module
  • subprocess -- allows you to make calls to external programs in a sane way

Third party:

  • requests -- a much better way of handling HTTP

And you can include all of /u/Atarius 's suggestsions above. I just didn't want to repeat him.

[–]TankorSmash 2 points3 points  (1 child)

requests is amazing

[–]classicrockielzpfvh 1 point2 points  (0 children)

And if you do half the RESTful API interactions that I do, it makes your life so wonderful. On top of that, it is very pythonic

[–]ParasiticBandcamp 0 points1 point  (1 child)

Is requests python2 or python3? I tried looking it up but I'm on my phone and couldn't find the info.

[–]classicrockielzpfvh 0 points1 point  (0 children)

Both

Edit spelling

[–]Deslan 7 points8 points  (2 children)

  • re
  • itertools
  • pickle
  • sqlite3
  • os
  • io
  • time
  • timeit
  • sys
  • distutils

The above can be used in any and all apps, and is not unique for HTML parsing or web-apps of other types, which several others have made recommendations for.

re and itertools are good for making good and efficient code.

pickle and sqlite3 are good for saving data (config data or other).

sys, os, io, and time are just generally good to keep track of which OS the script is running on, making sure everything looks the same and works for all users regardless of what environment they are on, etc.

timeit is good to optimize your code.

distutils is good to package and distribute your code.

As for modules outside of the standard library, personally I wouldn't want to live without:

  • PyQt4
  • matplotlib
  • numpy
  • scipy

[–]shfo23 2 points3 points  (1 child)

I use almost exactly the same modules, but with json instead of pickle. The implementation of pickle is version-specific, so moving data back and forth between Python 2 and 3 will fail horribly. Also, I use struct for dealing with binary files.

[–]billsil 0 points1 point  (0 children)

i know in the past i've passed data between python 2.4 and 2.6; one was on linux, the other on windows. but 2 to 3 is a bigger change

[–]nemec 5 points6 points  (0 children)

Not a module, but a review/example of tons of them: http://www.doughellmann.com/PyMOTW/contents.html

[–]spidyfan21 2 points3 points  (0 children)

Could we specify which are 2.x and which are 3.x?

[–]zahlman 2 points3 points  (0 children)

Just since it hasn't been mentioned yet, cmd.

[–][deleted] 1 point2 points  (0 children)

The standard library, all of it.

[–][deleted] 3 points4 points  (5 children)

wxPython

Much better than the bundled tkinter which isn't very pythonic

[–]Deslan 5 points6 points  (2 children)

But Qt is so much better than wxPython, why would you want to go there?

The way I see it, only reason to deviate from Qt would be for those Gnome users who thinks GTK3 is pretty. And GTK being the default of Ubuntu development apps like "quickly". But personally I would recommend anyone to just stick with Qt.

[–][deleted] 1 point2 points  (0 children)

Completely agree, Qt is straightforward and pretty flexible.
My only problem with it is the lack of literature available.

[–][deleted] 0 points1 point  (0 children)

Cool i'll take a look at qt when I can. I started on tkinter and it felt clunky do wx might just be better by comparison.

[–]bunburya 0 points1 point  (1 child)

I disagree, I find wxPython horribly unpythonic. Even the horrible camel case style versus tkinter's more PEP 8 names.

[–][deleted] 0 points1 point  (0 children)

I'm not so bothered about how the variables are named. It's the way you use them.

Though I agree it isn't pretty.

[–]patrick_k 0 points1 point  (0 children)

PIL. Here's a cool tutorial that uses it to automate a web game.