阅读背景:

在脚本中打开文件时,在编辑器中打开文件

来源:互联网 

I have the following code:

我有以下代码:

import os
import sys
import tempfile
import subprocess

with tempfile.NamedTemporaryFile('w+') as f:
    if sys.platform == 'linux':
        subprocess.call('vim', f.name)
    elif sys.platform == 'nt':
        os.system(f.name)
import o



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: