-3
Place in a file ". txt" the information contained in Linha2[0:6] which is:
['Mem ria', 'f¡sica', 'total:', '7.988', 'MB']
['Memria', 'f¡sica', 'available', '5.277', 'MB'']
['Mem ria', 'Virtual:', 'Size', ’M', 'ximo:', '9.268']
['Mem ria', 'Virtual:', 'Available:', '6.094', 'MB']
['Mem ria', 'Virtual:', 'Em', 'Use:', '3.174', 'MB']
archive_sysinfo = open('saida_systeminfo.txt', 'r')
text_sysinfo = archive_sysinfo.readlines()
lista_linhas2 = []
lista_info = []
for linha2 in text_sysinfo:
lista_linhas2.append(linha2.split())
for linha2 in lista_linhas2:
if "Mem¢ria" in linha2:
lista_info.append(linha2[0:6])
print(linha2[0:6])
EXIT:
Host name: FPAL169325
Operating system name: Microsoft Windows 8.1 Pro
Operating system version: 6.3.9600 N/A compiles‡Æo 9600
Operating system manufacturer: Microsoft Corporation
Configures‡æo of the OS: This‡æo member work
Compile type‡Æo of the operating system: Multiprocessor Free
Registered owner: SENAC FACULTY PORTO ALEGRE
Organizes‡Æo registered: SENACRS
Identifies‡Æo of the product: 00261-80511-41292-A269
Date of installation‡Æo original: 08/01/2018, 19:29:13
System Boot Time‡æo: 26/10/2018, 20:47:23
System manufacturer: LENOVO
System model: 32092F2
System type: x64-based PC
Processor(s): 1 processor(s) installed(s). [01]: Intel64 Family 6 Model 58
Stepping 9 Genuineintel ~3201 Mhz
BIOS Versæo: LENOVO 9SKT69AUS, 17/05/2013
Windows folder: C: windows
System folder: C: windows system32
Initialize device: Device Harddiskvolume1
System location: en;Portuguˆs (Brazil)
City of entry: en;Portuguˆs (Brazil)
Zone Hor river: (UTC-03:00) Brazil
Memria f¡sica total: 7.988 MB
Available memory: 5.277 MB
Virtual Memory: Size M ximo: 9.268 MB
Virtual Memory: Available: 6.094 MB
Virtual Memory: In Use: 3.174 MB
Page file location(s) ‡Æo: C: pagefile.sys
Dom¡nio: fspoaeduc.com.br
Login Server: CROM
Hotfix(s): 165 Hotfix(s) installed(s). [01]: Kb2899189_microsoft-Windows-Cameracodec-Package
What is the expected result? It’s not giving to understand what you need.
– fernandosavio
Read each list as a line ex.: Memria total 7.988 MB
– Homero
But don’t you have to put it in a file? What’s inside
sai_systeminfo.txt
? You could edit the question with this information?– fernandosavio
Yes do what was shown and put in a txt
– Homero
What you added is output or is the file
saida_systeminfo.txt
??– fernandosavio
This is the content of saida_systeminfo.txt
– Homero
From what I understand you want to read this file and create another file with the memory data copied to this new file. That’s it?
– fernandosavio
Perfeito Fernando
– Homero
I’ll formulate an answer then. But you need to try to be clearer when asking a question, you might already have a good answer if it were easier to understand.
– fernandosavio
Thanks for the help
– Homero
I don’t really know the question editing tools, so I try to pollute the screen as little as possible
– Homero
Homer, in help center has tips on how to edit/format your questions, and on FAQ also has a lot of information about it. Anyway, even if you don’t fully master the editing tools, first worry about making the question clear (see tips on [Ask] and how to mount a [mcve]). A clear and poorly formatted question can be edited by other users, already a question well formatted but not very clear does not have much to do, except ask the author clarify...
– hkotsubo
Okay, thank you hkotsubo
– Homero