面料-更改皮革的默认行为

时间:2019-06-21 12:40:22

标签: python fabric

我正在我的python脚本中使用fabricrunners的默认行为是显示所有输出“ hide = False”。 我的脚本有很多运行命令,我想将所有脚本的默认行为更改为“ hide = True”。

Sub Macro1()

Dim wsData As Worksheet, wsUrl As Worksheet, wbNew as Workbook
Dim CSVDir as String, rngU As Range

Set wsData = Workbooks("data.xlsx").Worksheets(1)
Set wsUrl = Workbooks("URLs.xlsx").Worksheets(1)
Set rngU = wsUrl.Range("A1", wsUrl.Range("A" & wsUrl.Rows.Count).End(xlUp))
CSVDir = "C:\Users\thomas.mcerlean\Desktop\Work\" 'you gave this as your dir
Set wbNew = Workbooks.Add

For Each cell In rngU
    wsData.Range("A1", wsData.Range("B" & wsData.Rows.Count).End(xlUp)).Copy Destination:= wbNew.Worksheets(1).Range("A1")
    wbNew.SaveAs Filename:= CSVDir & cell.Value & ".csv", FileFormat:=xlCSV
Next cell

wbNew.Close SaveChanges:=False
End Sub

是否有更改默认行为的选项或方法?也许在导入后就可以了吗?也许像

import fabric
fabric.Connection(t_host).run('test -d ' + lock_dir, hide=True)
fabric.Connection(t_host).run('ls -la' + lock_dir, hide=True)
fabric.Connection(t_host).run('rm -rf ' + lock_dir, hide=True)

0 个答案:

没有答案