gpt4 book ai didi

python - 使用Python中指定的程序打开特定文件。

转载 作者:太空宇宙 更新时间:2023-11-04 03:35:27 24 4
gpt4 key购买 nike

这是我编写的用于打开特定 nuke 文件和特定 3de 文件的 python 代码。 nuke 可以工作并打开特定的 nuke 文件,但 3de 不能。我收到一条错误消息“3de:找不到命令”。我正在尝试从 Maya 运行它以通过终端打开。

nFile="/sam/stuff/new.nk"
tFile="/sam/stuff/new.3de"



os.system("nuke %s &" %(nFile))
os.system("3de %s &" %(tFile))

最佳答案

3de 需要完整的文件路径和在项目文件路径前面打开的 3de 标志。感谢/user/那个人,很容易修复。

nFile="/sam/stuff/new.nk"
tFile="/sam/stuff/new.3de"



os.system("nuke %s &" %(nFile))
os.system("/c/3de/3de -open %s &" %(tFile))

关于python - 使用Python中指定的程序打开特定文件。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31752488/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com