If two servers were found at the same time, they might try to write to the xlsx file at the same time. this could corrupt the file. outputting to json, and just using another script to convert is much safer.
A python script to sort through a list of ip's to find working minecraft servers
Usage:
Usage: srvstatus.py -p IP srvstatus.py -f inlist.txt srvstatus.py -f inlist.txt -o outfile.json
Then convert json to xlsx using:
json2xlsx.py infile.json outfile.xlsx
Dependencies:
Pillow mcstatus openpyxl