pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/machphy/python_programming_/commit/66fdd99ead1b03165c7d7b9d27d5bcf1e87cd2fd

nymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-5efd63e783ac04bb.css" /> new · machphy/python_programming_@66fdd99 · GitHub
Skip to content

Commit 66fdd99

Browse files
committed
new
1 parent aae1c93 commit 66fdd99

1 file changed

Lines changed: 21 additions & 12 deletions

File tree

Airtel_udemy/new.py

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
new=('new')kB]
2-
Get:30 http://in.archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Components [940 B]
3-
Get:31 http://in.archive.ubuntu.com/ubuntu noble-backports/main amd64 Components [7,300 B]
4-
Get:32 http://in.archive.ubuntu.com/ubuntu noble-backports/restricted amd64 Components [216 B]
5-
Get:33 http://in.archive.ubuntu.com/ubuntu noble-backports/universe amd64 Components [10.5 kB]
6-
Get:34 http://in.archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Components [212 B]
7-
Fetched 5,731 kB in 7s (863 kB/s)
8-
Reading package lists... Done
9-
Building dependency tree... Done
10-
Reading state information... Done
11-
31 packages can be upgraded. Run 'apt list --upgradable' to see them.
12-
# rajeev@rajeevmachphy:~$
1+
import os
2+
from datetime import datetime
3+
4+
LOG_FILE = "system_logs.txt"
5+
OUTPUT_FILE = "collected_logs.txt"
6+
7+
def collect_logs():
8+
if not os.path.exists(LOG_FILE):
9+
print("Log file not found!")
10+
return
11+
12+
with open(LOG_FILE, "r") as src, open(OUTPUT_FILE, "a") as dst:
13+
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
14+
dst.write(f"\n--- Logs collected at {timestamp} ---\n")
15+
for line in src:
16+
dst.write(line)
17+
18+
print("Logs collected successfully!")
19+
20+
if __name__ == "__main__":
21+
collect_logs()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy