簡體   English   中英

無法使用python腳本從Perforce讀取數據

[英]Not able to read data from Perforce using python script

請幫助我從Perforce讀取數據/文件。
我嘗試使用以下代碼使用此python腳本從Perforce讀取文件。

即使在pycharm中一步一步執行時,相同的代碼在Python shell中也能正常工作,因此效果很好。

# copy the file from the P4 to the local computer
def getp4file(outfile,errfile,path):

    path = 'p4 print ' + path
    with open(outfile, "wb") as out, open(errfile, "wb") as err:
        subprocess.Popen(path, stdout=out, stderr=err)
    out.close()
    err.close()
    return


getp4file('config.txt', 'err.txt', 'path_of_the_file')

只是增加了一個延遲,一切正常。

返回語句前延遲5秒

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM