pc端启用微信小程序

1、将微信小程序添加到电脑桌面,如图
在这里插入图片描述

2、查找小程序所在路径
在这里插入图片描述
在这里插入图片描述
4、查找微信 WechatAppLauncher.exe所在路径(鼠标放置在桌面小程序图标上右键->打开文件所在位置) 如图:
在这里插入图片描述

5、小程序路径即为“D:\install\communication\WeChat\WechatAppLauncher.exe -launch_appid=wxece3a9a4c82f58c9” (WechatAppLauncher.exe所在路径 -launch_appid=wx…路径)

6、使用 subprocess 启用小程序

# coding=utf-8
import sys
import subprocess
import os
from time import sleep
import win32com.client
import json
import chardet




#检查进程是否存在
def check_exsit(process_name):
    WMI = win32com.client.GetObject('winmgmts:')
    processCodeCov = WMI.ExecQuery('select * from Win32_Process where Name like "%{}%"'.format(process_name))
    if len(processCodeCov) > 0:
        print(f"{process_name}:进程启动成功")
    else:
        print(f"{process_name}:进程启动失败")


def PrintEnv():
    print("os: " + sys.platform)
    print("python version: " + sys.version)

#关闭程序
def close_exe(name):
    # os.popen("taskkill /IM " + name + " -F")
    os.popen("taskkill /IM " + name)
    print(f"{name}:进程已关闭")



def open_exe(xcx_path):
    subprocess.Popen(xcx_path)  #打开小程序


xcx_path = "D:\\install\\communication\\WeChat\\WechatAppLauncher.exe -launch_appid=wxece3a9a4c82f58c9"

open_exe(xcx_path) #启动程序
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

生而为虫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值