【问题标题】:Sublime Text build system for input/output in python在 python 中用于输入/输出的 Sublime Text 构建系统
【发布时间】:2019-05-01 13:07:08
【问题描述】:

我想在 Ubuntu 中使用 Sublime Text 进行 python 编程,并想编写一个构建系统,该系统从提到的文件中获取输入并将输出打印到其他提到的文件中。我使用这段代码对 c++ 做了同样的事情:

{
    "cmd": ["g++ -std=c++11 ${file} -o ${file_path}/${file_base_name} && ${file_path}/${file_base_name}<${file_path}/inputf.in>${file_path}/outputf.in"],
    "shell" : true
}

【问题讨论】:

标签: python ubuntu sublimetext3


【解决方案1】:

Tushar 通过修改上面的代码找到了自己的解决方案,如下所示:

{
    "cmd": ["python ${file}<${file_path}/inputf.in>${file_path}/outputf.in"],
    "shell":true
}

【讨论】:

    【解决方案2】:

    以防万一有人在 Windows 中寻求解决相同问题的方法。对 J.Chomel 建议的答案进行了一些更改。会做的工作。 但首先,将您的输入和输出文件保存在您正在工作的同一文件夹中

    {
    "cmd": ["python", "${file}","<inputf.in>outputf.in"],
    "shell":true,
    "working_dir":"$file_path",
    }
    

    这是迄今为止运行 python 文件的最快方法,我从文件中获取输入并将输出保存在文件中。严重地。 :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-07-28
      • 1970-01-01
      • 1970-01-01
      • 2015-11-27
      • 2020-10-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多