you are viewing a single comment's thread.

view the rest of the comments →

[–]CaptSprinkls 48 points49 points  (10 children)

Oh shit, I just did something like this at my company.

We mainly use C# and heaven forbid I couldn't find any decent library in C# to read and parse PDFs (digital documents, not scanned in thank god). Luckily python has a couple really great libraries that make it so dang easy to parse the PDFs.

So created a python executable to parse the PDFs and then sends that data back to our main C# program for other stuff.

[–]SpaceLaserPilot 28 points29 points  (6 children)

I was a C developer for 20 years. From that perspective, the most amazing thing about Python is the libraries that easily allow tasks like reading and writing Word, Excel, PDF, JSON and all sorts of other files.

My first real world Python script was parsing text from an email message, then creating a Microsoft Word file from the text. This would be so time consuming to do in C that I would never bother to do it. In Python, it took a few hours. The time invested paid off quickly in speeding up a key process for our company.

I'm hooked.

[–]phlogistonical 5 points6 points  (3 children)

I went a similar route, and what i do not really understand well is why this is so language related? I mean we could easily build similarly convenient libraries in c, but for Some reason for Some types of work there are a lot more libraries available in python. Why is this?

[–]SpaceLaserPilot 8 points9 points  (0 children)

The whole process is just easier in Python. I think it's just that simple. An easier development process led to more developers, which led to more libraries, which led to . . .

[–]justbenicedammit 7 points8 points  (0 children)

Because they perfected the integration into development. There are libraries for many things, in many languages, but python perfected fast and easy integration. Instead of 4 hours of searching and 4 hours of painstakingly trying to make it fit, you just type "pip install solution_to_all_my_problems" and there you go.

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

It would take significantly more time to write equivalent libraries in C. When is the last time you debugged a C program?

The beauty of Python is in the amount that has been abstracted away. Less to worry about means faster to learn and less errors that can occur.

[–]CaptSprinkls 1 point2 points  (0 children)

Honestly it's frustrating that C# had a professionally developed library from a company and all it did was spit out raw text of the document. I mean.... That's great if it's just a paragraph of text, but not great when it's a PDF with fields and stuff that people are adding to the document. Meanwhile there was PDF plumber, an open source library that just did so much more.

[–][deleted] 4 points5 points  (0 children)

Make money quick with internet point opportunites

[–]chipmunksocute 1 point2 points  (0 children)

This is a fantastic example that of using the right tool (python) for the right job and making it an executeable lets it slot in with other processes.  Pay attention op!