You are not logged in.
Pages: 1
my actual goal is to conceive a frontend for pacman in python.
(similar to this one at first)
I have all of my frontend divided in sections. each section is a file that i open and close to get information. I can't manage so far to combine them in the same code. I'm wonder if i should use somes kind of arrays to collect each section data. my objectif is to have them reunite on the same code or at least same program.
example of a section.
# Open a file
words=""
with open("bd1.txt", "r") as fh:
for index in range(1):
line = next(fh)
print ("%s" % (line))
line = next(fh)
content=fh.readlines()
for lines in content:
if (lines[-12:] == "[installed]\n"):
lines1=(lines.replace("[installed]",""))
lines2=(lines1.replace(" ","/"))
lines3=(lines2.split("/")[1])
print (lines3)
# Close opend file
fh.close()
this one withdraw from pacman -Ss, filename only.
I got 3 others that withdraw information from this database (pacman -Ss).
* how can i use this code to return an array?
Offline
Pages: 1