free-x commited on
Commit
093841c
·
verified ·
1 Parent(s): 7e6dfee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -10,9 +10,15 @@ import platform
10
 
11
 
12
  def get_disk_usage():
 
 
 
 
13
  try:
14
-
15
- result = subprocess.run(['du', '-h', '/'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
 
 
16
 
17
 
18
  if result.returncode != 0:
@@ -20,12 +26,12 @@ def get_disk_usage():
20
  else:
21
  print(result.stdout)
22
 
23
- with open("111.txt", 'w') as file:
24
- file.write(result.stdout)
25
  print(f"Disk usage information written to {filename}")
26
  except Exception as e:
27
  print(f"An error occurred: {e}")
28
 
 
29
  def get_system_info():
30
  print("=== System Information ===")
31
  print(f"System: {platform.system()}")
 
10
 
11
 
12
  def get_disk_usage():
13
+
14
+ with open("111.txt", 'w') as file:
15
+ file.write(result.stdout)
16
+
17
  try:
18
+ tree = subprocess.run(['tree'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
19
+ print(tree.stderr)
20
+
21
+ result = subprocess.run(['du', '-h', './'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
22
 
23
 
24
  if result.returncode != 0:
 
26
  else:
27
  print(result.stdout)
28
 
29
+
 
30
  print(f"Disk usage information written to {filename}")
31
  except Exception as e:
32
  print(f"An error occurred: {e}")
33
 
34
+
35
  def get_system_info():
36
  print("=== System Information ===")
37
  print(f"System: {platform.system()}")