当前位置: 首页 > news >正文

开一个素材设计网站怎么做的政务公开和网站建设情况

开一个素材设计网站怎么做的,政务公开和网站建设情况,汕头网址模板建站,遂宁市网站建设有没有一种办法可以让我通过网页就能够实时查看远程电脑的程序运行情况呢#xff1f;为此#xff0c;我想到了利用python的Flask制作一个网页#xff0c;然后通过cpolar#xff0c;转变成一个互联网的网页#xff0c;方便随时了解电脑的程序运行情况#xff0c;比如百度网…有没有一种办法可以让我通过网页就能够实时查看远程电脑的程序运行情况呢为此我想到了利用python的Flask制作一个网页然后通过cpolar转变成一个互联网的网页方便随时了解电脑的程序运行情况比如百度网盘下载多少文件了python数据处理是否完成等等。 1.flask服务端 # -*- coding: utf-8 -*-Created on Tue Jun 17 20:52:47 2025author: YBK from flask import Flask, render_template, send_file import pyautogui import os import timeapp Flask(__name__)app.route(/) def index():return render_template(jp.html)app.route(/screenshot) def take_screenshot():screenshot pyautogui.screenshot()screenshot_path os.path.join(static, screenshot.png)screenshot.save(screenshot_path)return send_file(screenshot_path, mimetypeimage/png)app.route(/switch_window) def switch_window():pyautogui.hotkey(alt, tab)time.sleep(0.5) # 等待窗口切换完成return OKapp.route(/switch_window1) def press_win_1():try:pyautogui.keyDown(win)time.sleep(0.1) # 确保Win键按下pyautogui.press(1)pyautogui.keyUp(win)return OKexcept Exception as e:print(f操作失败: {str(e)})return Errapp.route(/switch_window2) def press_win_2():try:pyautogui.keyDown(win)time.sleep(0.1) # 确保Win键按下pyautogui.press(2)pyautogui.keyUp(win)return OKexcept Exception as e:print(f操作失败: {str(e)})return Errapp.route(/switch_window3) def press_win_3():try:pyautogui.keyDown(win)time.sleep(0.1) # 确保Win键按下pyautogui.press(3)pyautogui.keyUp(win)return OKexcept Exception as e:print(f操作失败: {str(e)})return Errapp.route(/switch_window4) def press_win_4():try:pyautogui.keyDown(win)time.sleep(0.1) # 确保Win键按下pyautogui.press(4)pyautogui.keyUp(win)return OKexcept Exception as e:print(f操作失败: {str(e)})return Errapp.route(/switch_window5) def press_win_5():try:pyautogui.keyDown(win)time.sleep(0.1) # 确保Win键按下pyautogui.press(5)pyautogui.keyUp(win)return OKexcept Exception as e:print(f操作失败: {str(e)})return Errapp.route(/switch_windowd) def press_win_d():try:pyautogui.keyDown(win)time.sleep(0.1) # 确保Win键按下pyautogui.press(d)pyautogui.keyUp(win)return OKexcept Exception as e:print(f操作失败: {str(e)})return Errapp.route(/switch_ct) def switch_ct():pyautogui.hotkey(ctrl, tab)time.sleep(0.5) # 等待窗口切换完成return OKapp.route(/switch_csi) def switch_csi():pyautogui.hotkey(ctrl, shift, i)time.sleep(0.5) # 等待窗口切换完成return OK if __name__ __main__:app.run(host127.0.0.1,debugTrue,use_reloaderFalse)2.放在templates的网页jp.html !DOCTYPE html html headtitle远程桌面控制/titlestyle#image-container {width: 800px;height: 600px;border: 1px solid #ccc;margin: 20px auto;}#screenshot-img {max-width: 100%;max-height: 100%;}.button-container {text-align: center;margin: 20px;}button {padding: 10px 20px;margin: 0 10px;font-size: 16px;}/style /head bodydiv classbutton-containerbutton idscreenshot-btn截屏/buttonbutton idswitch-btn切换/buttonbutton idswitch-btn1Win1/buttonbutton idswitch-btn2Win2/buttonbutton idswitch-btn3Win3/buttonbutton idswitch-btn4Win4/buttonbutton idswitch-btn5Win5/buttonbutton idswitch-btndWinD/button/divdiv idimage-containerimg idscreenshot-img src alt截屏将显示在这里/divdiv classbutton-containerbutton idswitch-btnctCtrlTab/buttonbutton idswitch-btncsiCtrlShiftI/button/divscriptdocument.getElementById(screenshot-btn).addEventListener(click, function() {fetch(/screenshot).then(response response.blob()).then(blob {const img document.getElementById(screenshot-img);img.src URL.createObjectURL(blob);});});document.getElementById(switch-btn).addEventListener(click, function() {fetch(/switch_window);});document.getElementById(switch-btn1).addEventListener(click, function() {fetch(/switch_window1);});document.getElementById(switch-btn2).addEventListener(click, function() {fetch(/switch_window2);});document.getElementById(switch-btn3).addEventListener(click, function() {fetch(/switch_window3);});document.getElementById(switch-btn4).addEventListener(click, function() {fetch(/switch_window4);});document.getElementById(switch-btn5).addEventListener(click, function() {fetch(/switch_window5);});document.getElementById(switch-btnd).addEventListener(click, function() {fetch(/switch_windowd);});document.getElementById(switch-btnct).addEventListener(click, function() {fetch(/switch_ct);});document.getElementById(switch-btncsi).addEventListener(click, function() {fetch(/switch_csi);});/script /body /html3.记得新建static文件夹在py程序的同个文件夹中。 4.使用cmd运行cpolar http 5000 5.python提取cpolar公网地址也就是4上面显示的网址发送给你的微信。用另外一个微信在服务器登录 # -*- coding: utf-8 -*-Created on Sat Mar 22 11:17:27 2025author: YBK import requests from bs4 import BeautifulSoup import sys import pyperclip from wxauto import * wx WeChat() who 你的微信名 # 登录网站并获取页面内容 def fetch_info_from_website(login_url, info_url, credentials, tunnel_name):with requests.Session() as session:try:# 获取登录页面以抓取csrf tokenlogin_page session.get(login_url)login_page.raise_for_status() # 检查请求是否成功login_page_soup BeautifulSoup(login_page.text, html.parser)# 提取csrf tokencsrf_token login_page_soup.find(input, {name: csrf_token})[value]credentials[csrf_token] csrf_token# 登录print(登录中请等待。)login_response session.post(login_url, datacredentials)# 检查是否登录成功if login_response.status_code ! 200 or login_response.url login_url:print(登录失败请检查您的凭据。)return []else:print(登录成功。)# 获取信息页面response session.get(info_url)response.raise_for_status()# 解析页面soup BeautifulSoup(response.text, html.parser)table soup.find(table)if not table:print(未找到隧道列表请检查对应设备的cpolar服务和网络连接。)return []links [] # 用于存储找到的链接for row in table.find_all(tr)[1:]: # 跳过表头cells row.find_all(td)if len(cells) 1:tunnel cells[0].get_text().strip()url_cell row.find(a, hrefTrue) # 直接在行中查找a标签if tunnel tunnel_name and url_cell:links.append(url_cell[href]) # 添加匹配的链接print(f找到隧道 {tunnel} 的链接: {url_cell[href]})return linksexcept requests.RequestException as e:print(f请求异常: {e})except Exception as e:print(f发生错误: {e}) if __name__ __main__:login_url https://dashboard.cpolar.com/logininfo_url https://dashboard.cpolar.com/statuscredentials {login: 你的账号,password: 你的密码}# 检查是否有命令行参数传入# if len(sys.argv) 1:# tunnel_name sys.argv[1] # 第一个命令行参数作为隧道名称# else:# print(请提供一个隧道名称作为参数或者留空以自动提示输入。)# tunnel_name input(请输入隧道名称: )# if not tunnel_name:# print(隧道名称不能为空。)# sys.exit(1)tunnel_name defaultlinks fetch_info_from_website(login_url, info_url, credentials, tunnel_name)if links:print(links[0])message links[0]wx.SendMsg(message, who)pyperclip.copy(links[0])else:print(f没有找到名为 {tunnel_name} 的隧道链接。) 运行界面 PS为了查看我的Spyder中程序的控制台我加上了CtrlTab和CtrlShifti每一次按后都要按一下截屏才会显示。
http://www.hkea.cn/news/14359941/

相关文章:

  • 合肥有哪些做网站的wordpress $show_date
  • 自己建网站花钱吗广州海珠区核酸检测点
  • 母婴会所 网站源码html5做的网站有哪些
  • 替人做赌彩网站被判刑wordpress资讯站
  • 温州微网站策划公司起名
  • 网站后台上传word个人网站如何进行网络推广
  • 快递网站模板网站建设客户需求表 文库
  • 苏州知名网站制作开发咨询类公司注册需要什么
  • 短视频素材下载网站 免费网站数据库设置权限
  • 社交信息共享网站开发外包网站备案要关多久
  • 淮南装饰公司网站建设深圳前十vi设计公司
  • 成都金融网站建设公司排名网页升级访问升级自动跳
  • 芗城区建设局网站洛阳网站建设哪家好
  • 做彩票网站服务器xyz域名做网站好么
  • 顶呱呱做网站吗河南怎样做网站推广
  • 怎么敲代码做网站南宁企业网站制作模板
  • 黄冈网站开发珠宝钻石网站建站
  • 网站建设网页设计电销外呼软件
  • 成都市做网站公司如网站站长如何对付黑客
  • 如何微信做演讲视频网站wordpress 固定网址
  • 深圳建设外贸网站wordpress 文章页调用
  • 微信分享的h5网站开发手机软件开发工程师
  • 网站开发及app开发报价四川建设培训网
  • 信阳网站推广公司wordpress强大的电商
  • 阿里云nas做网站互联网平台是做什么的
  • 建设项目环境影响评价登记表网站找程序员代写程序
  • 海外游戏推广平台seo网站优化方案案例
  • 系统网站自助建站建e室内设计网cad
  • 天德建设集团网站百度怎么优化网站关键词
  • 顺义区做网站建设英文版网站