Aug-05-2024, 07:27 AM
Hi Gribouilli,
Thanks for you hint. I just found a way using vi/vim:
Thanks for you hint. I just found a way using vi/vim:
import os, subprocess, sys Path = os.getcwd() AsciiFile = 'Ascii.txt' vimRun = subprocess.Popen('vi ' + Path + '/' + AsciiFile + ' +1,10d -c wq ', shell = True, stdin = None, stdout = None) # +1,10d => equivalent to ":1,10d" # "-c" <command> => the "c" of command to be executed # 'stdout = None' avoid echoesPaul