简体   繁体   English

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

[英]Opening a specific file with the program specified in Python.

This is the python code I wrote to open a specific nuke file and a specific 3de file. 这是我编写的python代码,用于打开特定的nuke文件和特定的3de文件。 The nuke works and opens the specific nuke file but the 3de doesn't. 核弹有效并打开特定的核弹文件,但3de无效。 I get an error saying "3de: command not found". 我收到一条错误消息:“ 3de:找不到命令”。 I'm trying to run this in from Maya to open through the terminal. 我正在尝试从Maya运行此程序以通过终端打开。

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



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

The 3de needed the full filepath and the 3de flag open in front of the project filepath. 3de需要完整的文件路径,并且3de标志在项目文件路径的前面打开。 Easy fix thanks to /user/that other guy. 易于修复,感谢/ user /那个家伙。

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



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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM