如何在vscode中构建和运行以及删除可执行文件和虚拟文件

时间:2019-04-28 05:36:43

标签: c++ visual-studio-code

我想构建并运行c ++源代码。然后删除除源代码以外的所有内容。

{
  "tasks": [
    {
      "type": "shell",
      "label": "g++ build active file",
      "command": "/usr/bin/g++",
      "args": [
        "-g",
        "${file}",
        "-o",
        "${fileDirname}/${fileBasenameNoExtension}",
        "&",
        "${fileDirname}/${fileBasenameNoExtension}",
        "&",
        "rm ",
        "${fileDirname}/${fileBasenameNoExtension}"
      ],
      "options": {
        "cwd": "/usr/bin"
      },
      "group": {
        "kind": "build",
        "isDefault": true
      }
    }
  ],
  "version": "2.0.0"
}

除了它们构建并运行然后删除毫无价值的文件外,我无法正常运行。

1 个答案:

答案 0 :(得分:1)

看看VScode tasks parameters,您会发现我们可以将它们与from PyQt5 import QtCore, QtGui, QtWidgets import pandas as pd import glob import os import csv class Ui_Rule_Priority_test(object): def setupUi(self, Rule_Priority_test): Rule_Priority_test.setObjectName("Rule_Priority_test") Rule_Priority_test.resize(577, 531) self.gridLayout = QtWidgets.QGridLayout(Rule_Priority_test) self.gridLayout.setObjectName("gridLayout") self.OpenCsv = QtWidgets.QPushButton(Rule_Priority_test) self.OpenCsv.setObjectName("OpenCsv") self.gridLayout.addWidget(self.OpenCsv, 0, 0, 1, 1) self.OpenCsv.clicked.connect(self.file_open) self.tableView = QtWidgets.QTableView(Rule_Priority_test) self.tableView.setObjectName("tableView") self.gridLayout.addWidget(self.tableView, 1, 0, 1, 1) self.Refresh = QtWidgets.QPushButton(Rule_Priority_test) self.Refresh.setObjectName("Refresh") self.gridLayout.addWidget(self.Refresh, 2, 0, 1, 1) self.retranslateUi(Rule_Priority_test) self.Refresh.clicked.connect(self.tableView.clearSpans) QtCore.QMetaObject.connectSlotsByName(Rule_Priority_test) def retranslateUi(self, Rule_Priority_test): _translate = QtCore.QCoreApplication.translate Rule_Priority_test.setWindowTitle(_translate("Rule_Priority_test", "Dialog")) self.OpenCsv.setText(_translate("Rule_Priority_test", "Browse Csv and Get Score")) self.Refresh.setText(_translate("Rule_Priority_test", "Refresh")) def file_open(self): fileName = QtWidgets.QFileDialog.getOpenFileName(Rule_Priority_test, 'Open csv' , QtCore.QDir.rootPath() , 'Violations_*.csv') #df1 = pd.DataFrame() #df1 = pd.concat([pd.read_csv(f) for f in glob.glob('Violations_*.csv')] , ignore_index=True) path = self.lineEdit.text(fileName) df1 = pd.read_csv(path) df2 = pd.read_csv('C:\\Testing bat\\10000TXsData.csv') df = pd.merge(df2, df1, how='inner').dropna(axis="columns") model = PandasModel(df) self.tableView.setModel(model) if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) Rule_Priority_test = QtWidgets.QDialog() ui = Ui_Rule_Priority_test() ui.setupUi(Rule_Priority_test) Rule_Priority_test.show() sys.exit(app.exec_()) 链接在一起。请注意,必需的dependsOn可以包含工具所在的完整路径,而该路径不包含在OS路径变量中,但是command应该包含工具应运行的路径,即{{ 1}}。另外,您应该研究options.cwd参数,并根据您希望看到错误的方式进行调整。

${fileDirname}