Hi All,
Am new to python and am trying to generate multiple filelist by reading a master file.
@library cells_lib /hello/this/is/file/path2/ver1/ver1.v: +libext+.v +define+functional +define+no_unit_delay +define+PWR_OFF +define+VEND1 /hello/this/is/file/path2/ver2/ver2.v: +libext+.v +define+functional +define+no_unit_delay +define+PWR_OFF +define+VEND1 /hello/this/is/file/path2/ver3/ver3.v: +libext+.v +define+functional +define+no_unit_delay +define+PWR_OFF +define+VEND1 /hello/this/is/file/path2/ver4/ver4.v: +libext+.v +define+functional +define+no_unit_delay +define+PWR_OFF +define+VEND1
@library cpu /hello/this/is/file/path3/topmod.v /hello/this/is/file/path3/midmod.v /hello/this/is/file/path3/lowmod.v
@library io_lib /hello/this/is/file/path5/mod5.vhd /hello/this/is/file/path5/midmod5.vhd /hello/this/is/file/path5/lowmod5.vhd
this is my code which I think is nothing, but any pointers will be great help please?
file_view =[]
with open('filelist.txt', 'r') as filehandle:
for line in filehandle:
stripped_line = line.strip()
line_list = stripped_line.split()
file_view.append(line_list)
print(file_view)
I need something like this for each at library section
output required gpu.f => should contain only list of files under at library gpu cells_lib.f cpu.f io_lib.f
how do I achieve this please, any pointers will be helpful.
Thanks in advance
What I have tried:
file_view =[]
with open('filelist.txt', 'r') as filehandle:
for line in filehandle:
stripped_line = line.strip()
line_list = stripped_line.split()
file_view.append(line_list)
print(file_view)