moi nguoi oi cho minh hoi tai sao minh khong in luon file target ra duoc thang PowerShell no cu bao cai loi nay : ,<_io.TextIOWrapper name='.\\file de xoa.txt' mode='w' encoding='cp1252'>
doan code cua minh day ;
#muc dich la hoi co muon xoa noi dung trong “file de xoa.txt” hay khong ?
from sys import argv
script, filename = argv
print ("Ban co muon xoa file %s hay khong?" % filename)
print ("Neu muon huy xoa thi an nut ctrl c")
print ("neu muon tiep tuc thi an enter")
input ("Tiep tuc xoa du lieu")
print ("Dang mo file %s......vui long cho trong giay lat" % filename)
target = open (filename, "w")
print ("file cua ban da duoc xoa")
print ("ban muon viet gi vao file moi?")
line1 = input ("cau thu nhat")
line2 = input ("cau thu hai")
line3 = input ("cau thu ba")
target.write(line1 + "\n" + line2 + "\n" + line3)
target.close()
print("file moi cua ban co noi dung la:")
print (target.read())
cam on moi nguoi