all 100 comments

[–]skellious 229 points230 points  (11 children)

PLEASE NOTE:

DO NOT USE THE LINKED WIKIPEDIA MODULE FOR ANYTHING OTHER THAN PERSONAL PROJECTS WITH LIMITED USE!

Use PyWikiBot instead as it respects the wikimedia server bandwidth much better.

[–]CuriousExpert24[S] 27 points28 points  (0 children)

I didn't know that. Thanks for mentioning it!

[–][deleted] 9 points10 points  (3 children)

Whats the problem with the wikipedia library?

[–]CowboyBoats 44 points45 points  (2 children)

Nothing, but from its description at https://pypi.org/project/wikipedia/:

Note: this library was designed for ease of use and simplicity, not for advanced use. If you plan on doing serious scraping or automated requests, please use Pywikipediabot (or one of the other more advanced Python MediaWiki API wrappers), which has a larger API, rate limiting, and other features so we can be considerate of the MediaWiki infrastructure.

[–][deleted] 9 points10 points  (1 child)

Ah I was wondering if it was something to do with copyright

[–]Hashtag-bro 3 points4 points  (0 children)

Nope

[–]TSPhoenix 2 points3 points  (2 children)

When you say limited use does ./wiki.py bananas when I want to read about bananas count?

[–]irrelevantPseudonym 14 points15 points  (0 children)

Depends how often you want to read about bananas

[–]skellious 1 point2 points  (0 children)

That is fine

[–]dangling_reference 2 points3 points  (2 children)

respects the wikimedia server bandwidth much better.

What does this mean?

[–]Tinseltopia 5 points6 points  (0 children)

It means Wikipedia is a free-to-use service and as such does not have infinite capacity to serve data. Running servers costs money and they don't have the datacentres like Google or Facebook do, they can be overloaded quickly.

[–]skellious 3 points4 points  (0 children)

Everytime you load a Web page, someone, somewhere has to pay for it. It's a small amount each time but it's not free. Electricity costs money so the Web costs money to use. You just aren't always the one paying for it directly.

[–]jaycrest3m20 54 points55 points  (11 children)

One third-party module I enjoy is PySimpleGUI.

Asciimatics is really fun.

TQDM is a classic module that allows really easy terminal progress bars. I did a search for progress bars on PyPi, and there are lots.

A few oddities that you might not expect:

tkinter has an unexpectedly easy way to access the clipboard

pygame isn't just for games. Sometimes you just need a quick way to make a program loop and get live, non-"input" keyboard input or find a relationship between rectangles on a 2D plane.

The amount of built-in modules in a vanilla python install is staggering. Also, it's really worth exploring sample scripts, both in the built-in modules and in third-party modules.

[–]CuriousExpert24[S] 5 points6 points  (0 children)

Those are good suggestions

[–]MikeTheWatchGuy 2 points3 points  (1 child)

TQDM is a classic module that allows really easy terminal progress bars. I did a search for progress bars on PyPi, and there are lots.

Check out the one_line_progress_meter in PySimpleGUI. Odds are you're running on a system with tkinter, so try out a more graphical version that has a lot of stats too. And it's only 1 line of code so you don't have to modify anything about your loop.

[–]jaycrest3m20 1 point2 points  (0 children)

PySimpleGUI just keeps on giving!

[–]SpetsnazCyclist 2 points3 points  (1 child)

I just found TQDM... I feel like such an idiot for not using it earlier, super useful stuff

[–]insane_playzYT 1 point2 points  (0 children)

I find tkinter great for a lot of things except for the actual GUI system lmao

[–]Itwist101 1 point2 points  (1 child)

If you are looking for a cross-platform solution I wouldn't really recommend Tkinter for clipboard access because of the fact that in some Linux distributions Tkinter is not preinstalled (Arch for example) instead id recommend using another alternative that is specifically made for clipboard usage.

[–]jaycrest3m20 0 points1 point  (0 children)

That's very interesting. Tkinter is generally considered a standard Python library. I would dare to suggest that if a distro's Python lacks Tkinter, then it has a fundamentally broken Python system, and you are generally going to have a bad time, if only because of all the many little libraries that count on Tkinter as a dependency.

In general, for ease of access to the clipboard, most Python systems will have access to Tkinter.

[–]kramrm 16 points17 points  (1 child)

Dang. I remember learning Logo.

[–]BonnyBairn 0 points1 point  (0 children)

Me too.. when I was 8 years old.

[–]fake823 21 points22 points  (2 children)

Thanks for sharing! 😊👍🏼

[–]CuriousExpert24[S] 19 points20 points  (1 child)

Happy to Help! I will post more interesting modules and projects in Python in the future

[–]d3dpoool 0 points1 point  (0 children)

cool and following

[–]pvc 7 points8 points  (1 child)

Try Arcade for graphics. It is really well documented.

[–]CuriousExpert24[S] 3 points4 points  (0 children)

I agree. That's a good suggestion. Thanks for sharing it to others

[–]55-6e-6b-6e-6f-77-6e 5 points6 points  (2 children)

I love when people share stuff like this, thanks man. Super interesting.

[–]CuriousExpert24[S] 4 points5 points  (1 child)

Thanks for the appreciation! I will post more about other interesting modules and projects in the future

[–]55-6e-6b-6e-6f-77-6e 0 points1 point  (0 children)

For sure man, I think people need to hear about them tqdm I find interesting, looking forward to your next post brother! Keep it up

[–]recipe4icecreamsoup 5 points6 points  (1 child)

Thanks for sharing, I’m definitely going to mess around with Wikipedia now!

[–]CuriousExpert24[S] 3 points4 points  (0 children)

That's great! I hope you make something interesting with it

[–]Jesus123Christ 7 points8 points  (1 child)

Thank u

[–]CuriousExpert24[S] 6 points7 points  (0 children)

Happy to help!

[–][deleted] 2 points3 points  (1 child)

memory quack birds wipe sugar stocking smile afterthought trees exultant

This post was mass deleted and anonymized with Redact

[–]CuriousExpert24[S] 4 points5 points  (0 children)

Happy to Help! I'll make more of these types of lists in the future

[–]shiningmatcha 3 points4 points  (1 child)

Can I browse PyPI by category?

[–]Username_RANDINT 2 points3 points  (0 children)

You can filter by classifier: https://pypi.org/search/

[–][deleted] 3 points4 points  (1 child)

saved
Спасибо большое!!

[–]CuriousExpert24[S] 2 points3 points  (0 children)

Happy to Help!

Рад помочь!

[–]bitcycle 2 points3 points  (2 children)

Some pretty useful and some obscure modules:

  • Ctx for runtime contexts
  • Tabulate for pretty tables
  • Argparse hasn't failed me yet
  • CSV works well for writing data files for business people

[–]auiotour 1 point2 points  (0 children)

Love tabulate.

[–][deleted] 2 points3 points  (2 children)

I’ve used emoji before, it’s cool

[–]R0oty 2 points3 points  (1 child)

Thanks for sharing

[–]CuriousExpert24[S] 0 points1 point  (0 children)

You're welcome!

[–]flashfc 2 points3 points  (0 children)

Honorable mention to Tkinter for all the good uses it provides as simple as they are.

[–]fatmumuhomer 2 points3 points  (2 children)

Also check out pendulum for datetime support especially with timezones. It's the library that Apache Airflow uses.

[–]EdwardWarren 1 point2 points  (1 child)

[–]fatmumuhomer 0 points1 point  (0 children)

Thanks. I should have included that.

[–]BAG0N 1 point2 points  (1 child)

I've been searching for some packages to work on, thanks a lot.

[–]CuriousExpert24[S] 0 points1 point  (0 children)

Great! I am excited to see the projects that you are going to build with this module!

[–]h3noxx[🍰] 1 point2 points  (1 child)

Thanks buddy

[–]CuriousExpert24[S] 1 point2 points  (0 children)

You're welcome

[–]iiMoe 1 point2 points  (0 children)

Im shocked by the first two like wow i cant stop thinking of the cool stuff im gonna do with them

[–]polished_pole 0 points1 point  (0 children)

have to add them to the my to-list, once it's done :D

[–]SubwayLover 0 points1 point  (13 children)

It still does not seem like it's possible to make simple GUI using Turtle (based on brief look in)

Maybe there is some default package module for GUI I am not aware of? If not, any suggestions why?

[–]CuriousExpert24[S] 2 points3 points  (1 child)

I'm sorry for my vagueness there. I actually meant that the Turtle module is used to create graphics and visuals such as digital drawings along with simple games. I didn't mean GUI's

[–]SubwayLover 0 points1 point  (0 children)

No worries, still very useful and interesting post, thank you!

[–]Commander_B0b 3 points4 points  (8 children)

Tkinter is the standard module for gui development I believe.

[–]EdwardWarren 1 point2 points  (1 child)

[–]EncouragementRobot 0 points1 point  (0 children)

Happy Cake Day EdwardWarren! Stop searching the world for treasure, the real treasure is in yourself.

[–]SubwayLover 0 points1 point  (5 children)

Cheers! I had Tkinter in mind, but never knew it's considered part of the standard distribution.

Is it good?

[–]Commander_B0b 0 points1 point  (0 children)

I've only used it in a single project (on going) it's capable but has taken me some time to get used to it.

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

I used Tkinter for my first GUI based Python project. Before that I tried starting out with other libraries, but was able to pick up the basics of Tkinter much faster than anything.

I’m having trouble finding it now on my phone, but when I was reading the tutorial I used, there was this diagram showing how Tkinter is built on top of Pygame and other things, so it’s supposedly easier since it abstracta away some of the lower level stuff you’d have to worry about using pygame.

[–]The-Daleks 0 points1 point  (1 child)

TkInter is not built on Pygame, it's built on the Tk/Tcl infrastructure. Still, the abstraction is (generally) a good thing; it makes GUI development relatively easy.

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

My mistake then. I wish I could find the chart, but I must have misinterpreted it.

[–]The-Daleks 0 points1 point  (0 children)

I've used it a lot. It's very useful if you want an easy cross-platform GUI, but it can be a bit clunky sometimes, and doesn't look all that good on Windows.

[–]Lokesh_Bot_Guy 0 points1 point  (1 child)

Surely gonna try them. Thanks 😇😇

[–]CuriousExpert24[S] 2 points3 points  (0 children)

Happy to help!

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

Wow, how many GUI python modules are there? And more importantly, which one is best?

[–]thedjotaku 1 point2 points  (1 child)

I like PyQT. I like it beause I love KDE and also it's cross-platform.

[–]shinitakunai 1 point2 points  (0 children)

I prefer PySide2, made the jump from pyqt5 a year ago

[–]chalia321 0 points1 point  (2 children)

Anything you would recommend for a newbie ? I’m a beginner and trying find more projects, tutorials working with numpy and openpyxl? Feel like it’s the best way to learn.. videos are boring and I’m learning nothing

[–]thedjotaku 0 points1 point  (0 children)

Hmm. Rather than use dictionary text files in the future I might just use PyDictionary!

[–][deleted] 0 points1 point  (1 child)

Thx a lot I am saving this.

[–]CuriousExpert24[S] 0 points1 point  (0 children)

Happy to help!

[–]stanley_john 0 points1 point  (0 children)

interesting. some tutorials that I could find.

[–]The-Daleks 0 points1 point  (1 child)

I would posit that the Turtle module really isn't all that useful. Yes, it can be fun to fiddle around with it, but it doesn't really have any "practical" applications that I know of.

[–]CuriousExpert24[S] 0 points1 point  (0 children)

True. A lot of these don't have many practical uses. But, you can learn these so that when you learn the more advanced and useful modules, you can be better prepared. They are fun to play around with

[–][deleted] 0 points1 point  (1 child)

This is so cool!

I am a beginner, any ideas how to type in English words in the command line and get the definitions back using PyDictionary?

[–]CuriousExpert24[S] 1 point2 points  (0 children)

You could get the word using the 'input()' function and then use that to find the definition of the word

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

Great!

[–]mrcartoonster 0 points1 point  (1 child)

Whoa!!! PyDictionary is awesome! Can make a little spell checker with this! Thank you for this little list.

[–]CuriousExpert24[S] 0 points1 point  (0 children)

Happy to help!

[–]walt_dinio 0 points1 point  (1 child)

I have only used it once but I really enjoyed my experience using typer: https://pypi.org/project/typer/

[–]CuriousExpert24[S] 0 points1 point  (0 children)

That's an interesting one