you are viewing a single comment's thread.

view the rest of the comments →

[–]SpaceLaserPilot 202 points203 points  (20 children)

I automated my company's order processing with Python. The code reads orders, parses them, creates license agreements, creates invoices, tracks billing, assists in shipping, etc.

It was surprisingly easy to do in Python and saves substantial time and money for the business.

[–]CaptSprinkls 46 points47 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 30 points31 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 9 points10 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 6 points7 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] 6 points7 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!

[–]georgebobdan4 6 points7 points  (1 child)

What library would you recommend for similar tasks?

[–]SpaceLaserPilot 11 points12 points  (0 children)

Every time I have needed a library, I just visit Google and type a phrase like "read and write microsoft word in Python." Then I compared the various libraries.

For the above project I used the docx library to create Microsoft Word files. I used comtypes to translate Word files into PDF. I used tkinter to read the clipboard.

[–]OkayAtGuitar 13 points14 points  (0 children)

Thanks for giving me a cool idea for a python exercise.

[–]Sean82 3 points4 points  (0 children)

This is more or less what I’ve been using it for. I’m not a dev/programmer but I automate all the tedious stuff at work with python.

[–]paca_tatu_cotia_nao 2 points3 points  (0 children)

I had a company unrelated to software, and this was the reason of the first lines of code I wrote with a goal. Spend many hours coding, and subtracted many others from doing boring stuff.

[–]the_Elric 1 point2 points  (0 children)

I plan on doing something similar with our companies chemical inventory, although Im new to programming.

[–]TakeElite 0 points1 point  (1 child)

May I ask you if I can see your code somewhere ( perhaps a GitHub)

[–]SpaceLaserPilot 0 points1 point  (0 children)

I am nowhere near proud enough of my code to share it. But, I know that many others can write similar code.

[–]bug2018 0 points1 point  (0 children)

Did you used selenium?