Skip to content

Commit ea09b7c

Browse files
committed
Update basic_operation.py
1 parent a483c99 commit ea09b7c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

General/basic_operation.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def list_to_file(input_list,output_file):
1111
def file_to_list(input_file):
1212
def get_file_details(input_file):
1313
def file_string_replace(input_file):
14+
def check_file(input_file):
1415
'''
1516

1617
#Remove Duplicates from list - Input (ipaddress)1 | Output (status)1
@@ -90,4 +91,11 @@ def file_string_replace(input_file):
9091
f2=open(input_file,"w+")
9192
f2.write(input)
9293
f1.close()
93-
f2.close()
94+
f2.close()
95+
96+
#Check file and exist and file is not empty - Input (filename)1 | Output(status)
97+
def check_file(input_file):
98+
status=False
99+
if os.path.isfile(input_file) and os.path.getsize(input_file) > 0:
100+
status=True
101+
return status

0 commit comments

Comments
 (0)