Code is now a funtion
This commit is contained in:
parent
bbd35358e4
commit
85626bd795
34
infBack.py
34
infBack.py
|
@ -1,26 +1,32 @@
|
||||||
import yaml
|
def get_vect():
|
||||||
|
|
||||||
rawDat = open('rss_univ.txt', 'r')
|
import yaml
|
||||||
|
|
||||||
strDat = rawDat.read()
|
rawDat = open('rss_univ.txt', 'r')
|
||||||
|
|
||||||
rawDat = strDat.split(';\n')
|
strDat = rawDat.read()
|
||||||
|
|
||||||
index = len(rawDat) - 1
|
rawDat = strDat.split(';\n')
|
||||||
rawDat.pop(index)
|
|
||||||
|
|
||||||
strDat = []
|
index = len(rawDat) - 1
|
||||||
|
rawDat.pop(index)
|
||||||
|
|
||||||
for i in rawDat:
|
strDat = []
|
||||||
strDat.append(yaml.load(i))
|
|
||||||
|
|
||||||
del rawDat
|
for i in rawDat:
|
||||||
|
strDat.append(yaml.load(i))
|
||||||
|
|
||||||
|
del rawDat
|
||||||
|
|
||||||
|
impDat = []
|
||||||
|
for d in strDat:
|
||||||
|
impDat.append([d['entries'][0]['title'], d['entries'][0]['links'][0]['href'], d['entries'][0]['summary']])
|
||||||
|
|
||||||
|
del strDat
|
||||||
|
|
||||||
|
return impDat
|
||||||
|
|
||||||
impDat = []
|
|
||||||
for d in strDat:
|
|
||||||
impDat.append([d['entries'][0]['title'], d['entries'][0]['links'][0]['href'], d['entries'][0]['summary']])
|
|
||||||
|
|
||||||
del strDat
|
|
||||||
|
|
||||||
# this section of the code show how to extract relevant data from the dictionaries
|
# this section of the code show how to extract relevant data from the dictionaries
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue