wsl 可以直接打开windows的应用 /mnt/d/blender/blender.exe

/mnt/d/blender/blender.exe

这个是可以直接运行的,直接打开windows的blender

而且程序关了,blender也不会关

python 复制代码
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import subprocess
import sys
import os



def start_blender():
    """
    启动Blender
    """
    blender_exe ="/mnt/d/blender/blender.exe"


    # Linux原生Blender
    subprocess.Popen(
        [blender_exe],

        start_new_session=True
    )

 


def main():
    """
    主函数,处理命令行参数
    """

    try:
        # 处理命令行参数
        if len(sys.argv) > 1 and sys.argv[1] == 'start':
            # 直接启动Blender
            start_blender()
            print("Blender activation started")
        else:
            # 默认直接启动
            start_blender()
        
        print("Command executed")
    except Exception as e:
        print(f"Error: {e}")
        sys.exit(1)


if __name__ == "__main__":
    main()

这样的话没有blender的控制台

python 复制代码
    # Linux原生Blender
    subprocess.Popen(
        [blender_exe],
        stdin=subprocess.DEVNULL,
        stdout=subprocess.DEVNULL,
        stderr=subprocess.DEVNULL,
        start_new_session=True
    )
相关推荐
DAVIED913 天前
llama.cpp 本地部署完全指南
windows·llama·wsl·llamacpp
深念Y14 天前
Windows → WSL2 全面迁移:工具链、Docker、OpenCode
linux·运维·windows·docker·容器·环境·wsl
x8623 天前
在 WSL 里把 Vulkan 跑起来
wsl·vulkan
Better Bench1 个月前
WSL2 Ubuntu 中 Claude CLI “command not found” 故障排查与修复
linux·ubuntu·claude·wsl·claudecode
圣殿骑士-Khtangc1 个月前
WSL2 + Redis Stack 完整部署教程(Windows 11)
windows·redis·wsl
Imagine Miracle2 个月前
【WSL】让WSL2后台持久运行不自动关闭的解决方案
linux·windows·wsl
zhou135284822672 个月前
Linux 系统安装 Ollama 详细教程
linux·ubuntu·wsl·ollama
西游音月2 个月前
Windows环境下的WSL+Claude Code安装配置
windows·大模型·ai编程·wsl·claude code
随风一样自由2 个月前
【WSL+Linux】国内网络连接微软官方服务器(或GitHub)不稳定,导致下载内核或Linux发行版时超时断开如何解决?
linux·服务器·wsl
假如梵高是飞行员2 个月前
WSL2 从 img 镜像文件启动特定 Linux 发行版完整指南
linux·windows·wsl