diff options
author | alexej996 <aleksej@spidermail.tk> | 2018-11-08 01:02:49 +0100 |
---|---|---|
committer | alexej996 <aleksej@spidermail.tk> | 2018-11-08 01:02:49 +0100 |
commit | 57e5f7f2a9756241cc65d17d8e19f947117bafc2 (patch) | |
tree | 48ba4faba41057a0880614f5a76567f9eeaafc28 /tmap | |
parent | 85aa48ce97d32f485503dd833d853b3ece6651f1 (diff) |
adding newlines to the end of f.write
Diffstat (limited to 'tmap')
-rwxr-xr-x | tmap | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -154,11 +154,9 @@ def main(): exit() ## Checking for file output - if(OUTFILE != "empty_outfile"): + if OUTFILE != "empty_outfile": f = open(OUTFILE, "w") - - - + ## Display message that scan is starting print("Starting a scan...") @@ -168,20 +166,19 @@ def main(): r = hostScan(h, PORTS, WAIT_TIME, CLEARNET) for i in r.keys(): if len(r[i]) != 0: - if(OUTFILE == "empty_outfile"): + if OUTFILE == "empty_outfile": print('{} open ports: {}'.format(i, str(r[i]))) else: - f.write('{} open ports: {}'.format(i, str(r[i]))) + f.write('{} open ports: {}\n'.format(i, str(r[i]))) ## Record time of program stopping and display the time running to the user endTime = time.time() totalTime = round(endTime - startTime, 2) - if(OUTFILE == "empty_outfile"): + if OUTFILE == "empty_outfile": print("Scan done in {} seconds".format(totalTime)) else: - f.write("\n") - f.write("Scan done in {} seconds".format(totalTime)) + f.write("Scan done in {} seconds\n".format(totalTime)) f.close() print("Results written to {}".format(OUTFILE)) |