日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

pythonstdin_如何写入Python子进程'stdin?

發(fā)布時間:2024/7/23 python 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 pythonstdin_如何写入Python子进程'stdin? 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

下面是它的樣子對NUKE 11.3v4的商業(yè)版本W(wǎng)indows 10:import subprocess# Run NUKE's script in Terminal mode on Windows machine...subprocess.Popen(['C:/Program Files/Nuke11.3v4/Nuke11.3.exe', '-t', 'E:/NukeTest/test.nk'], stdin=PIPE, stdout=PIPE)

以下是NUKE 11.3v4的非商業(yè)版本的工作原理macOS 10.14:import subprocessfrom subprocess import Popen, PIPEimport time# Run NUKE's script in Terminal mode on MacOS machine...np = subprocess.Popen(['/Applications/Nuke11.3v4/NukeX11.3v4 Non-commercial.app/NukeX11.3v4 Non-commercial', '-t', '/Users//Desktop/test.nknc'], stdin=PIPE, stdout=PIPE)# Choose a method to wait for the subprocess to finish...np.wait() time.sleep(5) data = np.communicate(input='data')[0]print(data)

結果如下:'''

NukeX 11.3v4, 64 bit, built May 1 2019.

Copyright (c) 2019 The Foundry Visionmongers Ltd. All Rights Reserved.

Non-commercial mode active.

Licence expires on: 2019/7/27

(11, 3, 4)

('darwin', 'posix')

/Applications/Nuke11.3v4/Nuke11.3v4.app/Contents/MacOS/../Frameworks/Python.framework/Versions/Current/

Disk cache /var/tmp/nuke-u501/ViewerCache/??: 424MB (5% of 10240MB) used in 81 files.

'''

此外,您可以使用-v圖像標志在GUI中運行子進程:subprocess.Popen(['C:/Program Files/Nuke11.3v4/Nuke11.3.exe', '-v', 'E:/NukeTestImages/image.exr'], stdin=PIPE, stdout=PIPE)

希望這可以幫助。

總結

以上是生活随笔為你收集整理的pythonstdin_如何写入Python子进程'stdin?的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。