Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 4081
1
#!/usr/bin/env python3
2
# coding: utf8
3
4
'''
5
This creates an index file `index.js` such that SageMathCloud (https://cloud.sagemath.com)
6
knows about each relevant file, information in it, etc.
7
8
The format of `index.js` is standard JSON, such that a node.js process can read it easily.
9
'''
10
11
from json import dump
12
from codecs import open
13
from glob import glob
14
from os.path import isdir
15
16
index = []
17
18
for fn in glob("*"):
19
if isdir(fn):
20
index.append(fn)
21
22
with open("index.js", "w", "utf8") as out:
23
dump(index, out)
24
25
26