pythonweb管理电脑_Python远程控制局域网计算机网络远程控制软件Python的开发,python,电脑,web...
[Python] 純文本查看 復制代碼import web import os
import time
from PIL import ImageGrab
import numpy as np
import cv2
urls = (
'/reboot_html/(.*)', 'reboot_html',
'/jp_html/(.*)', 'jp_html',
'/shutdown_html/(.*)', 'shutdown_html',
'/(js|css|images)/(.*)', 'static'
)
app = web.application(urls, globals())
render = web.template.render('templates/')
#重啟電腦
class reboot_html:
def GET(self, text):
print('input:' + text)
adb ='shutdown -r now'
d = os.popen(adb)
return render.reboot(content=text.upper())
#截屏
class jp_html:
def GET(self, text):
print('input:' + text)
beg = time.time()
debug = False
# img = ImageGrab.grab(bbox=(250, 161, 1141, 610))
img = ImageGrab.grab()
end = time.time()
print('time:',end - beg)
# img.show()
img.save("images/screen.jpg")
return render.jp(content=text.upper())
#關閉電腦
class shutdown_html:
def GET(self, text):
print('input:' + text)
adb ='shutdown -s -f'
d = os.popen(adb)
return render.shutdown(content=text.upper())
class static:
def GET(self, media, file):
try:
f = open(media+'/'+file, 'rb')
return f.read()
except:
return ''
if __name__ == "__main__":
app.run()
總結
以上是生活随笔為你收集整理的pythonweb管理电脑_Python远程控制局域网计算机网络远程控制软件Python的开发,python,电脑,web...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python 编辑距离_最小编辑距离py
- 下一篇: python创建sqlite3数据库_树