0
pythonノートブックでは、最初の行のtemp引数を最後の行に渡したいのですが、それをどうするかわかりません。シェルへのPython引数の受け渡し
!cp {folder}/done/sigdet_output*out temp{new_name}
あなたは通常、あなたのシェルで実行されるものである
def grabdata(statefolders, temp, split_by):
for folder in statefolders:
sub = folder.split('_')[split_by]
new_name = sub + '_out.txt'
!cp {folder}/done/sigdet_output*out temp{new_name}
あなたの最後の行には、単に '' 'SyntaxError'引き起こします''。 あなたは '' 'subprocess.run( 'cp {folder}/done/sigdet_output * out {temp} {new_name}')のようなことをしますか?format(folder = folder、temp = temp、new_name = new_name)、shell = True) '' '? –