„jupyter.adoc“ hinzufügen
This commit is contained in:
parent
016138e6f3
commit
fd23273081
39
jupyter.adoc
Normal file
39
jupyter.adoc
Normal file
@ -0,0 +1,39 @@
|
||||
# Python Code
|
||||
|
||||
[source,python]
|
||||
----
|
||||
from IPython.display import Markdown as md
|
||||
base = "https://fhnw.swisscovery.slsp.ch/discovery/%22
|
||||
tab = "&tab=41SLSP_FHNW_MyInst_and_CI&search_scope=MyInst_andCI&vid=41SLSP_FNW:VU1&offset=0"
|
||||
search = "search?query=any,contains,({})"
|
||||
# Input, Jahr + Monate
|
||||
year = "2023"
|
||||
months = ["03", "04", "05"]
|
||||
themes = ["Allgemeines, Umweltschutz, Spielfilme, Kinder- und Jugendmedien",
|
||||
"Theologie, Philosophie, Ethik, Psychologie",
|
||||
"Pädagogik",
|
||||
"Germanistik, Sprach- und Literaturwissenschaft",
|
||||
"Anglistik, Romanistik, Latein",
|
||||
"Kunst, Gestaltung, Musik, Sport"
|
||||
]
|
||||
markdown = "# Neubewerbungslisten"
|
||||
# Loop über Themen mit Index
|
||||
#for i in range(1, 3):
|
||||
for i in range(len(themes)):
|
||||
md(" Index no {i}")
|
||||
# Loop über Monate um die Zahlen zusammen zu setzen
|
||||
nums = []
|
||||
for m in months:
|
||||
|
||||
# format pattern zum Einfügen von Jahr, Monat und Indexziffer
|
||||
# Die Ziffer ist eines höher, als der Listenindex
|
||||
# wird zur Liste der 'OR' verknüpfungen hinzugefügt
|
||||
nums.append("ENE60{}{}{:02d}".format(year, m, (i+1)))
|
||||
|
||||
# die Liste wird mit '+OR+' verbunden
|
||||
query = '+OR+'.join(nums)
|
||||
url = base + search.format(query) + tab
|
||||
|
||||
text = "<li><a href='" + url + "'>" + themes[i] + "</a></li>"
|
||||
print(text)
|
||||
----
|
||||
Loading…
Reference in New Issue
Block a user