当前位置:网站首页>Write a wechat double open gadget to your girlfriend
Write a wechat double open gadget to your girlfriend
2022-04-23 07:19:00 【Lin Jinpeng】
PC End wechat double opening
Preface
I got a wechat double opening script for my girlfriend , It's solved. She's been using fast double clicking Enter Key to start double wechat .
After reloading wechat recently , The installation path has changed , As a result, the previous script cannot be used . After my detailed guidance , She still doesn't understand , So I decided to teach her in a simpler way . The original startup method was to make... With wechat path bat Script , Copy as many lines as you need to start , Last saved as “ Wechat double open .bat”
@echo off
start /d "C:\Program Files (x86)\Tencent\WeChat\" WeChat.exe
start /d "C:\Program Files (x86)\Tencent\WeChat\" WeChat.exe
exit
One 、 New implementation
The new implementation is to have a startup program : WeChat 2.exe
① Find the wechat installation path
②C Create a new disk root directory wechat.txt fill ① The path of replication .
Click on " WeChat 2.exe" Start the program , If you want to modify the number of starts , Only need to modify " WeChat 2.exe" The number of .
1. Realization effect
2. Get wechat installation path
Mouse over wechat Icon , Right click to view properties , Copy the path to the starting location .

Two 、 Implementation code
import os
import sys
import re
if __name__ == '__main__':
# Get the file name
fileNmae = sys.argv[0]
# Extract the number of the file name , As the number of wechat launches
count = int(re.findall('\d+', fileNmae)[0])
# Get wechat installation directory
with open('C:\wechat.txt','r') as f:
path=f.read()
# Start wechat
for i in range(0, count):
os.system(f'start /d {path} WeChat.exe')
3、 ... and 、 Use PyInstaller Pack it up exe Executable file
PyInstaller It's a Python The program is packaged into a single executable package , Support Windows、Linux and Mac OS X.
PyInstaller You can read the Python Script . It analyzes your code to find all the other modules and libraries needed for script execution . then , It will collect copies of all these files 、 Including activities Python Interpreter . And put it in a single folder with the script , Or optionally in a single executable .
1. install Pyinstaller
pip install pyinstaller
2. Packing command
Pyinstaller -F main.py
3.PyInstaller Common options supported
| Instructions | explain |
|---|---|
| -F,-onefile | Generate a single executable file |
| -D,–onedir | Generate a directory ( Contains multiple files ) As an executable |
| -a,–ascii | It doesn't contain Unicode Character set support |
| -d,–debug | produce debug Version of the executable |
| -w,–windowed,–noconsolc | Specifies that the command line window is not displayed when the program is running ( Only on Windows It works ) |
| -c,–nowindowed,–console | Specifies to use the command line window to run the program ( Only on Windows It works ) |
| -o DIR,–out=DIR | Appoint spec Directory where files are generated . If not specified , By default, the current directory is used to generate spec file |
| -p DIR,–path=DIR | Set up Python Path to import module ( And set up PYTHONPATH The role of environmental variables is similar ). You can also use the path separator (Windows Use semicolon ,Linux Use a colon ) To separate multiple paths |
| -n NAME,–name=NAME | Designated project ( Produced spec) name . If you omit this option , Then the main file name of the first script will be spec Name |

版权声明
本文为[Lin Jinpeng]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230609473474.html
边栏推荐
猜你喜欢

Cause: dx. jar is missing

给女朋友写个微信双开小工具

C# EF mysql更新datetime字段报错Modifying a column with the ‘Identity‘ pattern is not supported

ThreadLocal, just look at me!

常用UI控件简写名

机器学习 二:基于鸢尾花(iris)数据集的逻辑回归分类

Component based learning (1) idea and Implementation

1.2 preliminary pytorch neural network

第4章 Pytorch数据处理工具箱
![[2021 book recommendation] practical node red programming](/img/f4/e397c01f1551cd6c59ea4f54c197e6.png)
[2021 book recommendation] practical node red programming
随机推荐
PyTorch最佳实践和代码编写风格指南
组件化学习(3)ARouter中的Path和Group注解
face_recognition人脸检测
MySQL数据库安装与配置详解
Android interview Online Economic encyclopedia [constantly updating...]
[dynamic programming] different paths 2
Gephi教程【1】安装
读书小记——Activity
What did you do during the internship
PaddleOCR 图片文字提取
PyMySQL连接数据库
MySQL notes 2_ data sheet
HandlerThread原理和实际应用
Android exposed components - ignored component security
Handlerthread principle and practical application
Keras如何保存、加载Keras模型
torch.mm() torch.sparse.mm() torch.bmm() torch.mul() torch.matmul()的区别
ProcessBuilder工具类
机器学习 三: 基于逻辑回归的分类预测
素数求解的n种境界