Anh Anh - 2 years ago 259
Linux Question

Use sed command in python

How to use in python for long linux command. Like if I want to edit a file call records.txt by replacing all the comma with whitespace in linux shell, I can:

tr ',' ' ' < records.txt

How to use that with python in

Answer Source



python file:

import subprocess"tr \',\' \' \' < records.txt", shell=True)


jflaskdzhuskajkdkhdsa dakssdsd s a sa sas s  sas wwq wq wq w q wq wq  wq wq e d rdsa s aa ews  WQD AS SA WRFDSS
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download