Skip to content

Commit 3f4fa3b

Browse files
author
sbouii
committed
add get_text_content.py
1 parent fdb5a64 commit 3f4fa3b

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎get_text_content.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import os
2+
from os.path import join
3+
for (dirname, dirs, files) in os.walk('.'):
4+
for filename in files:
5+
if filename.endswith('.txt'):
6+
filepath = os.path.join(dirname, filename)
7+
filecontent = open(filepath, 'r')
8+
get_lines = list()
9+
for line in filecontent:
10+
get_lines.append(line)
11+
filecontent.close()
12+
print filepath
13+
for elem in get_lines:
14+
print elem

‎machine_ports_scanner.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def scan_ports():
1212
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
1313
result = sock.connect_ex((ip_address, port))
1414
if result == 0:
15-
print "Port {}: Open".format(port)
15+
print "Port {}: Open".format(port)
1616
sock.close()
1717

1818
except KeyboardInterrupt:

0 commit comments

Comments
 (0)