Difference between revisions of "Calamity track/Script"

From Wildermyth Wiki
m
 
Line 1: Line 1:
This is a [https://www.python.org/downloads/ Python] script to generate the [[calamity track]] table. Copy the code in the box below into a text file named '''<nowiki>calamityTable.py</nowiki>''' (or whatever you want) inside the '''<nowiki>Wildermyth</nowiki>''' directory. Then run it by calling '''<nowiki>python calamityTable.py</nowiki>''' from the command line. It will create a text file named '''<nowiki>calamityTable.txt</nowiki>''', which is wiki-formatted and can be pasted into the [[calamity track]] page.
This is a [https://www.python.org/downloads/ Python] script to generate the [[calamity track]] table. Copy the code in the box below into a text file named '''<nowiki>wikiCalamityTable.py</nowiki>''' (or whatever you want) inside the '''<nowiki>Wildermyth</nowiki>''' directory. Then run it by calling '''<nowiki>python wikiCalamityTable.py</nowiki>''' from the command line. It will create a text file named '''<nowiki>wikiCalamityTable.txt</nowiki>''', which is wiki-formatted and can be pasted into the [[calamity track]] page.


{| role="presentation" class="wikitable mw-collapsible mw-collapsed"
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"
| '''<nowiki>calamityTable.py</nowiki>'''
| '''<nowiki>wikiCalamityTable.py</nowiki>'''
|-
|-
|
|
Line 112: Line 112:
string += 'Last updated [[%s]] using [[/Script|this script]].\n'%version[:-1]
string += 'Last updated [[%s]] using [[/Script|this script]].\n'%version[:-1]
    
    
with open('calamityTable.txt', 'w') as f:
with open('wikiCalamityTable.txt', 'w') as f:
   f.write(string)</nowiki>
   f.write(string)</nowiki>
|}
|}

Latest revision as of 13:38, 5 March 2022

This is a Python script to generate the calamity track table. Copy the code in the box below into a text file named wikiCalamityTable.py (or whatever you want) inside the Wildermyth directory. Then run it by calling python wikiCalamityTable.py from the command line. It will create a text file named wikiCalamityTable.txt, which is wiki-formatted and can be pasted into the calamity track page.