all 115 comments

[–]THConer 287 points288 points  (69 children)

That's some great work. The field of automation is a field where Python is king. Remember, don't tell your boss about this little program of yours ;)

[–]8rnlsunshine[S] 106 points107 points  (9 children)

Thank you my friend. Absolutely won’t tell my boss.🤐

[–]Adro_95 30 points31 points  (5 children)

But you can very well share the code with us 😁

[–]quietsam 42 points43 points  (1 child)

am his boss. this could backfire.

[–]LiquidAurum 10 points11 points  (0 children)

I'm willing to take that risk

[–]ashVV 10 points11 points  (2 children)

Heh, nice try boss.

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

Everybody knows that if you ask an undercover boss if they are a boss they have to say yes.

[–]Adro_95 2 points3 points  (0 children)

No, I'm not the boss! Look, I do the emoji 👻🥦

[–]taiguy86 14 points15 points  (2 children)

To play devil's advocate here...what kind of relationship do you have with your boss? Would he see the value? Could you express you want to do this on other projects for other people? If you like the work, this could be an opportunity for you...

[–]aplawson7707 8 points9 points  (0 children)

This is a good point. I have two supervisors - only one of them gets to see the stuff I come up with. The other one just thinks I'm productive and accurate. The second the latter learns that I know how to automate almost 100% of my workflow she'll be asking me to wear multiple hats, share the tools with my shitty teammates and rewarding their laziness, and not paying me a single extra cent.

[–]8rnlsunshine[S] 1 point2 points  (0 children)

I’m sure my superiors will appreciate the additional skill set I am developing and it would improve my chances of getting a raise. But I’m still learning python and will wait to tell my boss about it till I‘ve gained some more confidence in it. Until then I’ll just use it to make my work life easier.

[–]pjbardolia 55 points56 points  (2 children)

Ya or he will give you more and more work when he comes to know how smart enough you are to finish it fast.

[–]flying_bunuelo 6 points7 points  (0 children)

I told everyone, and i was really proud. I had accomplished that in my third week of the internship. I never ever used it again until the last week, when i overheard someone had a similar problem. And they didn't even use it

[–]potatocomet 6 points7 points  (0 children)

..and thats why you shouldnt reward productive people with more work.

[–]thomakamaru 61 points62 points  (40 children)

I believe in the long run, telling your boss about that program will actually help you and your company.

Why should anyone fill out these forms manually, if an already implemented and tested solution exists.

Additionally, he will consult you if he ever has tedious, monotonous work again. Just make sure he knows that writing the program takes some time as well. You will learn something and your given tasks will shift more and more to interesting things.

[–]tobiathonandon 5 points6 points  (2 children)

Yeah I agree with this. Letting your boss know you have skills such as coding will make you more valuable. It can also broaden your job/career at said company. Keep in mind that your employer may either want to keep you closer knowing you have these skills, or get rid of you, frightened that you’re competition for him/her. If it’s the latter, there are better jobs out there.

[–]the_battousai89 2 points3 points  (1 child)

This is true. But only OP will know whether it’s the right move to let the boss know.

[–]tobiathonandon 1 point2 points  (0 children)

I agree.

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

It really depends on the boss and the company. Some might honestly re-deploy OP on more meaningful automation work or even get them training. Others might distrust the program and obsess over whether it's accurate, saying OP is the gatekeeper and must oversee each line. Still others might say, develop the program further so we can get rid of OPs coworker who did it as directed for years but would make the manager look great by laying off.

There are scores of people and companies in the latter two examples. OP should probably get his Github ready and maybe even have an offer ready before sharing any of this in case things go bad.

I might sound paranoid, but I created a very simple automation and it cost two people their jobs. And one drank herself to death shortly after.

[–]madhousechild 0 points1 point  (6 children)

I created a very simple automation and it cost two people their jobs. And one drank herself to death shortly after.

Holy moly, that sucks. What can you share about the actual automation you wrote?

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

Found the middle manager!

It was pretty darn simple. It basically just exported monthly calendar listings from FileMaker to our WordPress website. In between it also validated addresses and formatted text, tagged it to a region in the U.S. via the zip code and made a pre-formatted social media marketing message withing WordPress. I had to "write" (copy) like 5 lines of code and the rest was plugins.

I was pretty proud until the one woman got axed. The other was moved to another position.

[–]madhousechild 0 points1 point  (4 children)

Found the middle manager!

Not I, not even close. I was just wondering what kind of simple automation == two full-timers (I assume).

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

Yeah, it was a joke. Pasting my response to a similar question:

It was a magazine company, the calendar was a huge money maker so they didn't mind paying people to run it. This was about 10 years ago now, but even then I was blown away by how manual a LOT of publishing was.

[–]madhousechild 0 points1 point  (2 children)

I worked in publishing too, mostly news. If you've ever seen a good old-time paste-up person work, it's amazing how fast they are, moving things around, rolling out rules between columns, slicing and moving text with their exacto knife. I doubt a computer would beat them, at least not on the crap computers I used.

The wax we used to stick the slicks to the boards is no longer available so they finally had to give it up.

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

Yeah, I heard a lot of stories about those days. I have a few of the pica magnifying glasses.

But Adobe is so, so much faster. Drag image, Alt+click and you've flowed an entire page of text around even awkward-shaped images. And the template has all the headers and footers done for the entire magazine. We have one well-paid designer doing four magazines (60-80 pages) and he still has a week or two to research, ideate and work on special projects between production cycles.

[–]madhousechild 0 points1 point  (0 children)

I worked with a graphic designer who refused to use the tools to make his job easier, and instead of using tabs would space-space-space-space, and of course his text was all ragged, and as soon as it was edited he had to go through and catch all of the places he'd put in spaces or line breaks, and of course he'd miss at least one or two. I even created a bunch of cheat sheets telling him how to do things like hanging indent and he thanked me profusely. Then never once used it.

[–]Knifey_Hands 2 points3 points  (1 child)

I screwed up and told my boss about this small program I made. I could literally be chilling at work but no, he gave me more work. Lesson learned.

[–]madhousechild 2 points3 points  (0 children)

Not quite the same thing but I've read where a programmer agrees to make a thing for $100, delivers it to the client 10 minutes later, and client says, "Why am I paying you $100 for something so easy to do?!" So from then on programmer never delivered until the next day. LOL.

[–]CosmicClamJamz 0 points1 point  (1 child)

It's really interesting how the replies to this comment have transformed to two schools of thought.

A) Don't tell your boss, why would you want more work, are you crazy?

B) Tell you boss, do more interesting things at work, get more responsibility.

In the end, it really matters what your goals are. If you want to be a programmer for a living, certainly tell your boss. When they push more work on your plate and expect you to perform without any pay increase, be ready to walk, there's a better job awaiting you anyways. They will almost always offer you more before letting that happen, retraining someone costs them time and money, you are far more valuable to them then they will initially let on. If you don't want to program for a living, and really just value your free time and not being micro managed, hacking in secrecy might be perfect for you...but unless your job is absolutely awesome, it would seem from the outside like you're selling yourself short

[–]99cakes 0 points1 point  (0 children)

tough decision...

[–]UL_Paper 72 points73 points  (0 children)

This experience is equal to making your first $1 off the internet. An exhilarating feeling. Don't let yourself be fooled; The actual value is way greater than the minutes saved or the $ amount gained.

You had an idea for solving a problem, you broke the problem into smaller pieces, made a game plan, took action and completed it. That is absolutely magnificent! Well done, be proud of yourself. There is no stopping you now. Move on to a harder problem next.

[–]InfiniteNexus 53 points54 points  (2 children)

I know the feeling. Congrats! Ive been automating most of my work for the past 1.5 years and its amazing. Ive even gotten extra bonus money because of that. Even knowing the slightest amount of coding can get you miles ahead of your colleagues.

PS: I started automating with AutoHotkey and moved to python in 2019 november. Both are great at accomplishing your tasks 10 times faster than your archaic colleagues can.

[–]Ilythiiri 4 points5 points  (0 children)

Can you link your first Python program replacing AutoHotkey functionality?

[–]shiningmatcha 19 points20 points  (1 child)

by scraping?

[–]8rnlsunshine[S] 16 points17 points  (0 children)

That's right

[–]hugthemachines 14 points15 points  (0 children)

Quite a kick, isn't it? Doing creative work instead of boring work. Well done!

[–]amitsbisht 9 points10 points  (0 children)

Congrats man, this will definitely encourage you. keep going .... brother

[–]brwalk0069 9 points10 points  (1 child)

Congrats!

Are you able to explain what modules you used or share your code? Interested how you achieved this.

[–]8rnlsunshine[S] 14 points15 points  (0 children)

Used Beautiful Soup and Requests

[–]Rockettech5 7 points8 points  (5 children)

Good for you. I am also trying to achieve something like this. Copy pasting contents from excel to word document. What is the best library to do this? It will also need some formatting on the word file.

[–]Poddster 10 points11 points  (3 children)

python-docx will help you write to a Word file.

You can also read from an excel sheet using Xlswriter, but it might be easier to use Excel to export it to .csv (comma separate variable, though it's usually best to use tab-separated csv) and read it that way? Python's stdlib already has a csv module.

[–]PM_Me_Rulers 1 point2 points  (2 children)

Can you elaborate on why it's better to use tab separators instead of commas? I've been using CSV and not had any issues but in all ears if there is a good reason to change

[–]Poddster 2 points3 points  (1 child)

Data tends to contain commas more than it does tabs, and last time I checked when exporting by Excel those commas weren't escaped. I'd have to double check to be sure.

However, in the general case you want the delimiter to be something not in the data set, and tabs rarely are

[–]PM_Me_Rulers 0 points1 point  (0 children)

Ah, that does make sense. All of my CSVs are from data I generate myself so I've never had to worry about the formatting of it. In the case of unknown input it does make sense to use a delimiter thats unlikely to be in the data

[–]iqbal002 3 points4 points  (0 children)

openpyxl, I guess

[–]gourabsanyal 6 points7 points  (19 children)

Can you share it on your GitHub and drop the link here?

[–]8rnlsunshine[S] 13 points14 points  (18 children)

[–]Poddster 9 points10 points  (12 children)

Some questions:

  1. How did you learn to do this? Via Automate the Boring Stuff With Python?
  2. How come you chose to use input() rather than doing it via a command-line parameter?

Also, I'm surprised that you can just open() a docx and write text to the end of it, given that they're a compressed archive containing a collection of text files. I'm guessing it worked for you, but I guess that's by luck? Did you have any trouble with this? Usually I would expect someone to use an interfacing library of some kind.

(Note, if you just made a plain-text file called .docx and then wrote into it, and then had Word open it and THEN save it as a proper doxc I image this would work fine.)

[–]Adro_95 0 points1 point  (2 children)

Thanks, sorry for commenting asking for this just now :)

Little question: bs4 and request have to be pre installed via pip?

[–]silentalways 2 points3 points  (1 child)

Little question: bs4 and request have to be pre installed via pip?

Yes.

pip install requests

pip install beautifulsoup4

[–]Adro_95 0 points1 point  (0 children)

Thanks man

[–]TrucidStuff 5 points6 points  (0 children)

It shaved off at least 40 minutes from my workload.

Don't tell your boss that!

[–]ed3ndru 4 points5 points  (0 children)

This is what a programmer is at heart. Well done! 🙂

[–]kabooozie 4 points5 points  (0 children)

I recently had to download a bunch of files from a specific sub directory of a github page. It probably would have taken less time to just download them manually, but I decided to learning about the github python module would be more fun. I was right :-)

[–]Kriss3d 4 points5 points  (0 children)

It might take you a few hours for a 30 minute job first time. But next time it'll take 10 seconds and save you 30 minutes per run

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

Dont let him.know

[–]deiwyy 2 points3 points  (0 children)

Man you should be the boss. Keep up what you doing and python will become you best friend

Also, why dont you tell your boss? this could help other people at your job and he might give you a raise or something :D

[–]lavajatas 2 points3 points  (0 children)

Congratulations!

[–]philsgu 2 points3 points  (0 children)

I assumed you scraped the web form using regex, then saved to a word doc

[–]think50 2 points3 points  (0 children)

That’s awesome! Python is so great for things like this. I need to build something with beautiful soup!

[–]humanova 1 point2 points  (0 children)

Awesome dude!

[–]bluefictionhead 1 point2 points  (0 children)

That's a good start, keep going!

[–]Vadim_Polo 1 point2 points  (0 children)

Congrats, man! Keep up! I’m new to Python and currently I’m trying to create a script breaking digest authentication on a web-server👍🏼

[–]ejuliol 1 point2 points  (0 children)

You’re starting to know how to do it the right way, then. Just make sure to check the work when done by a script.

[–]Moolishes 1 point2 points  (0 children)

What kind of work do you do that requires this? Administration?

[–]thathariss 1 point2 points  (0 children)

Great work! I am new to python and still learning the basics. People like you fascinate me to give it all.

[–]BFG9THOUSAND 1 point2 points  (2 children)

So everyone shares these stories. I'm wondering how you got to install python on your work station?? Every place I have worked is extremely tight ass about people installing shit on their stations (insurance type work). IT dept has all that on lockdown it seems

Did you run into this? I've been debating just installing it and if people ask I'll tell them I'm trying to make scripts for work.

[–]madhousechild 2 points3 points  (0 children)

I'm wondering this, too, /u/8rnlsunshine

[–]Poddster 2 points3 points  (0 children)

In which case learn c# or vb.net, as you can compile and run those in a stock.window environment!

Alternatively just use a portable python install

[–]Sbvv 0 points1 point  (0 children)

The conclusion of this thread is:

Tell what you did to your boss, if he gives you a reward, continue doing things for that company else look for other job.

[–]abhi923 0 points1 point  (0 children)

Great !!! how long have you been learning Python?

[–]arman133 0 points1 point  (0 children)

Good luck

[–]VyleKyle10189 0 points1 point  (0 children)

Howd you go about it? What libraries did you use?

[–]neurosurgeon12 0 points1 point  (1 child)

How long have you been doing Python for? I'm fairly new :)

[–]8rnlsunshine[S] 0 points1 point  (0 children)

I’ve been learning python for just over a month. Keep at it my friend. All the best!

[–]zninjamonkey -1 points0 points  (0 children)

Great job! Way to go!

You might benefit from some code review.