trsinstall-python
v1.2.0
Published
Automated installer for TRS Python application with Python 3.12 - supports local copy or remote download. Includes PowerShell one-liner for Windows.
Maintainers
Readme
trsinstall-python
自动化安装 TRS Python 应用程序,包括:
- 复制/下载文件到
C:\python3 - 安装 Python 3.12.1
- 使用清华镜像源安装 pymysql、jieba、paramiko
提供两种安装方式:
- npm 包方式 - 需要 Node.js,适合开发者
- PowerShell 脚本方式 - Windows 原生,不需要额外依赖(推荐)
方式一:PowerShell 一键安装(推荐,不需要 Node.js)
把 install.ps1 和所有 Python 文件一起上传到你的服务器,然后用户只需要在 PowerShell 中运行:
$env:REMOTE_BASE_URL = "https://your-server.com/path/to/files/"; iex (irm $env:REMOTE_BASE_URL/install.ps1)或者用批处理文件 install.bat:
set REMOTE_BASE_URL=https://your-server.com/path/to/files/
install.bat就是这样! Windows 自带 PowerShell,不需要安装任何东西,直接运行就行。
方式二:npm 包方式
需要先安装 Node.js,然后:
npm install -g trsinstall-python本地使用(从本地目录复制)
trsinstall默认从 D:\Work\日常更新\trsinsert-python3 复制文件。
远程使用(从你的服务器下载)
首先将 trsinsert-python3 目录下的所有文件上传到你的服务器(例如 https://your-server.com/files/trsinsert-python3/),然后运行:
Windows CMD:
set REMOTE_BASE_URL=https://your-server.com/files/trsinsert-python3/ && trsinstallPowerShell:
$env:REMOTE_BASE_URL = "https://your-server.com/files/trsinsert-python3/"; trsinstallGit Bash / WSL:
REMOTE_BASE_URL=https://your-server.com/files/trsinsert-python3/ trsinstall安装说明
- 安装过程中会自动打开 Python 安装程序,请按照提示完成安装
- 推荐选项:
- Install for all users (安装到
C:\Python312) - 勾选 "Add Python to PATH"
- Install for all users (安装到
- 安装完成后会自动继续安装依赖包
文件列表
需要在服务器上提供以下文件:
- Clear0file.py
- TRSExecute.py
- TrsIntoNews.py
- TrsIntoNews2.py
- TrsIntoNews3.py
- TrsIntoWeibo.py
- ftptrans.py
- get_process.py
- killpythonw.bat
- python-3.12.1-amd64.exe (约 26MB)
- stop_words.txt
- update_keywords.py
启动程序
安装完成后,可以用以下命令启动程序:
python C:/python3/TRSExecute.py hostname,execute许可证
MIT
