From 57e5f7f2a9756241cc65d17d8e19f947117bafc2 Mon Sep 17 00:00:00 2001 From: alexej996 Date: Thu, 8 Nov 2018 01:02:49 +0100 Subject: adding newlines to the end of f.write --- tmap | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'tmap') diff --git a/tmap b/tmap index 92ba600..3585c21 100755 --- a/tmap +++ b/tmap @@ -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)) -- cgit v1.2.3