我希望將文本文件的內容用作我的python腳本的輸入。這是我的劇本。我想替換幾句話:將文本文件的內容作爲python腳本的輸入
import subprocess
import fileinput
import sys
import os
for line in text:
line = line.replace("/dev/sda3 ", "")
line = line.replace("/dev/sda6 ", "")
line = line.replace("/dev/sda2 ", "")
line = line.replace("/dev/sda1 ", "")
line = line.replace("tmpfs ", "")
任何建議,非常感謝。
...所以什麼是你的問題? – DBedrenko