socialnerds/hive
socialnerds
/
hive
Archived
1
0
Fork 0

added my first python funciton

This commit is contained in:
David 2012-05-15 23:25:27 +02:00
parent 7b79020887
commit 05cb3947ec
1 changed files with 17 additions and 7 deletions

View File

@ -4,13 +4,23 @@
import os import os
#reading needed files # reading a file
file = open("/proc/partitions", "r") def fileparser(path):
parts = file.read() file = open(path, "r")
file.close() result = file.read()
file = open("/proc/mounts", "r") file.close()
mounts = file.read() return result
file.close()
#file = open("/proc/partitions", "r")
#parts = file.read()
#file.close()
#file = open("/proc/mounts", "r")
#mounts = file.read()
#file.close()
# reading needed files
parts = fileparser("/proc/partitions")
mounts = fileparser("/proc/mounts")
partitions = [] partitions = []