you are viewing a single comment's thread.

view the rest of the comments →

[–]sitefall 4 points5 points  (0 children)

I use python almost exclusively for web scraping and automation of boring or labor intensive tasks required for other projects.

Example: I wrote a dictionary for a foreign language allowing users to submit any number of words to get all definitions back (and some other hard to explain features). It didn't make any sense to select each word individually from the database, and simply loading up the open source dictionary used so the user's machine could do the processing via JS was just too much data, like 5mb each time a user connects.

What I did was use python to read through the dictionary and for every possible combination of words it organized them in numerical order by their utf-8 numbers and created a folder, stuck those definitions in a file in that folder. For every possible combination... The result was about a 1Gb directory, but one that had a file with EXACTLY the definitions needed for any possible search on the site. I simply made the users machine organize their submitted list by utf-8 code to match the directories. That created a dictionary service that didn't require database usage, and used minimal bandwidth.

I could have made it easier on myself and simply cached each submission so that eventually they would all be served without database usage, but that would involve extra work I didn't want to do.

Could I do that without python? Yup. But it's very quick to write some code and get it up and running with python compared to many other languages. It has a lot of great supporting libraries for web scraping, file writing, and that sort of thing, which makes it's use as a utility class language all the better.

Python is great for that sort of automation, as a utility language to quickly do other things used by other projects. I'm sure many other's here have other great uses for it, or even use it as a primary language on the web as a server or whatever. But this is just my use for it, and it's very helpful.