新手python学习中 写了一个发现可用wifi的小文件 但是想输出到TXT文件保存时,发现只保存第一行 请大佬帮忙指教下那错了 跪谢
import subprocess
result = subprocess.check_output(['netsh','wlan','show','network'])
result = result.decode('gbk')
lst = result.split('\r\n')
lst = lst[4:]
f = open("d:\out.txt","a+")
for index in range(len(lst)):
if index %5 == 0:
print(lst[index],file=f)
f.close()