Skip to content

Commit cbd15a3

Browse files
committed
Test File
1 parent 4e29901 commit cbd15a3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Day-12/test.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def Update_Server_ConfigFile(file_path, key, value):
2+
with open(file_path, "r") as file:
3+
lines = file.readlines()
4+
5+
with open(file_path,"w") as file:
6+
for line in lines:
7+
if key in line:
8+
file.write(key + "=" + value + "\n")
9+
else:
10+
file.write(line)
11+
12+
Update_Server_ConfigFile("server.conf","MAX_CONNECTIONS", "1000")
13+

0 commit comments

Comments
 (0)