Erstmal ich bin neu hier und verstehe nicht all zu viel von Python und weiß auch nicht in Welche Abteilung diese Frage gehört.
Ich muss für die Schule ein Python Script schreiben, das die Folgenden CPU und Memory Infos ausgibt:
-CPU:
- - Vendor
- - Model
- - mhZ
- - Cache
- - Memory Total
- - Memory Free
- - Buffers
- - Cached
Mein Code sieht momentan so aus:
Code: Alles auswählen
#!/usr/bin/python3.2
# Skript: M122_Scripts/python/systeminfo.py
import sys
import listcpuinfo
import listmemoryinfo
mem = listmemoryinfo.getmemoryinfo()
memtotal = mem[0]
memfree = mem[1]
buffers = mem [2]
cached = mem[3]
for sys.argv in mem:
print(str(listmemoryinfo in sys.argv))
cpu = listcpuinfo.getcpuinfo()
vendor = cpu[1]
model = cpu[4]
mhz = cpu[6]
cache = cpu[7]
for sys argv in cpu:
print(int(sys.argv in cpu))Ich hoffe ihr könnt mir bei meinem Problem weiterhelfen.
MFG
MrAeon


