r/learnpython • • Feb 29 '20

Actually used python today

I've been learning python for about a month now. I started with automate the boring stuff like so many others have. Since then I have made some small games to practice. I am currently working on a hangman game and needed a list of words to use. I found a list of words and copied the whole thing to a .text file but it came with extra stuff I didn't need. So instead of manually deleting everything I didn't need I made a python script to do it for me. GREATEST FEELING EVER.

393 Upvotes

63 comments sorted by

View all comments

63

u/schwitaner Feb 29 '20

What boring stuff did/can you automate?

0

u/[deleted] Feb 29 '20

[deleted]

4

u/[deleted] Feb 29 '20

AS400 represent!

→ More replies (5)

14

u/Nixellion Feb 29 '20

a lot of boring jobs can be completely automated :D

8

u/[deleted] Feb 29 '20

Like what? I work as a Help desk and want to learn Python, but I can’t think of what it would be useful for.. :(

30

u/Nixellion Feb 29 '20

Well, try contacting microsoft support and you'll realise that its a bot, most likely written in python :D

The logic is - what repetitive tasks you do? Do you have to do the same thing more than 3 times in short period of time? Then its likely it can be automated, the question is how.

4

u/[deleted] Feb 29 '20

Off the top of my head I can’t think of anything to be honest and most issues I can fix pretty quick or it’s a printer issue lol

4

u/Nixellion Feb 29 '20

Well I dont know how helpdesk works, you'd have to describe your daily routine for me to be able to think of something

6

u/[deleted] Feb 29 '20

It’s pretty boring. I get in to work and go through all my tickets to see the new ones that get auto assigned to me then determine next steps and schedule them. I then watch YouTube or Anime and do the tickets.

I don’t know how people find stuff to do with Python! But maybe my job just sucks lol

8

u/Nixellion Feb 29 '20

Mhm, well, that's very general overview of what you do, you need to go deeper into details. What actions do you perform? How do you find tickets? Where do you look for answers and info for them?

Though from this general description it looks like it's just already automated for you. You most likely get tickets from some application or system, which most likely runs on a central server and is likely, surprise, written in Python :D Or something similar.

So yeah, some jobs are already automated for you and it's hard to find something. But you can automate stuff outside of your job too. Or find another job :D One that can get help from python. I work with gamedev and VFX and there's ton of stuff that can be automated, and it's so happens that Python is industry standard scripting language for CG software (except Adobe because they are huge shlongs)

8

u/sportsroc15 Feb 29 '20

Yeah people don’t understand that most of the already automated stuff we use are computer scripts and what we do as software engineers is work with that already automated software and update it and make it better as time goes along. Also automate new things as needed.

→ More replies (1)

5

u/Yakhov Feb 29 '20

Write a script that reads each ticket, uses key words to generate an auto reply to the problem and closes the ticket.

3

u/[deleted] Feb 29 '20

I'm curious about this, mainly for the scanning. We can't close out tickets right away, as we're expected to reach out to the user (yay customer service /s).

Would I need special access if our ticket system is web based, or would it be better to just scan the ticket notifications we receive in email instead as it has the pertinent issue in that email (no user details).

3

u/Kryma Feb 29 '20

You could use selenium to interact with the web-based system!

→ More replies (0)

2

u/Yakhov Mar 01 '20

You could scrape the web stuff with beautiful soup, or thers proly an easier way to get it from the email. I seen tutorials on sentiment analysis for tweets or whatever. You proly already have a bunch of boiler plate responses to trigger based on the content keywords; run it through a neural network to select the best response and fire off a reply. THen go watch more tiktok

2

u/[deleted] Feb 29 '20

You can get in to proactive incident management. I have a lot of experience with this. I use my scripts to scan for and remediate problems before the user sees them.

After a couple of years of proactive incident management, we brought incident reports down from ~160,000 tickets a year to ~70,000. Were still continually improving this program.

Do note, I am an engineer, not front line support. If you go this route, make sure your management backs you and is willing to elevate your position if you make things run smoother. Otherwise you may make yourself redundant.

→ More replies (2)

2

u/[deleted] Mar 01 '20

I am pretty sure you could write a script in python that will watch YouTube for you!

→ More replies (1)

3

u/barryhakker Feb 29 '20

Part of the learning process is going though existing functions and realizing how you could put a few of them together to do some basic task for you. Even when you do a basic python challenge it’s amazing to see how different people came to the same results with different methods.

3

u/[deleted] Feb 29 '20

If you have any regular reporting to do, I have found Python to be a very helpful helper. I use Pandas and Matplotlib to automate a reoccurring report that was quite the waste of time.

Every third week or so I get an Excel spreadsheet of vacation and sick leave balances for approximately 1500 employees from a legacy system. The report gives the first and last name, their salary (but not the hourly wage), the leave balances, and the employee's position number. The position number contains the employee's position job number, and the division and branch they work in (e.g., 123-321-4444), all of which is needed for the final report.

The script I wrote: extracts the position, division, and branch identification, calculates the hourly salary, and aggregates the leave balances according to unit, branch, and division for each level of employee. These aggregations are used to create heat maps for each organizational level with the balances (because management loves heat maps, sizzle sizzle), and then a cheeky little printout using f-strings that describes the heat map or individual employee. For example, there is a heat map of leave balances for all clerical staff in Unit A, all technicians in Unit A, and all Managers in Unit A. Each of these are then rolled up into a heat map for all clerical/technicians/managers in Branch A (which is comprised of Units A, B, C, D, and E), and then rolled up once more for a total of seven-ish Division heat maps. For posterity I use Pandas to create Excel spreadsheets of the individual DataFrames.

To manually accomplish this in Excel, people were spending between 8 and 12 hours across a few days. Via Python, this is completed in under a minute. It takes me longer to email the results to people than it does to do the work.

→ More replies (2)

1

u/majik00027 Mar 01 '20

you can automate excel

3

u/8rnlsunshine Feb 29 '20

Can you automate living?

3

u/Nixellion Feb 29 '20

sigh

But actually yeah, sort of, I mean just strictly Python speaking - HomeAssistant is #1 home automation platform right now, and it can automate a lot of your daily tasks. You can then dig into robot stuff, Raspberry Pis, ESP modules, Arduino and automate basically everything, so you'd only need to sit on the couch and everything else will be automated :D Like a bot can order food, robot can drive to the door, smart lock will open it, smart doorbell will tell courier to open the door himself (or you can automate door openning with motors, why not), robot will take that pizza box and drive to you. I mean... While it would sound like sci fi even 10 years ago - it's all really doable now.

Python is also leading language when it comes to neural networks, so yah

3

u/dstnmyrs Mar 01 '20

I deleted numbers and whitespace from a text file to leave just the words. Would have taken a lot longer if I did it manually. Three minutes to write it and 1 second to perform it.

1

u/FoxClass Feb 29 '20

Butter passing. Effortless waffles.

→ More replies (1)