Mercurial > hg > webaudioevaluationtool
comparison pythonServer.py @ 2064:10f38996f89a
Automatically go to right folder when running server locally so you can drag and drop the script in Terminal (after typing 'Python').
author | Brecht De Man <b.deman@qmul.ac.uk> |
---|---|
date | Fri, 03 Jul 2015 19:50:12 +0100 |
parents | 9806e44df26f |
children | 99cb3436759e |
comparison
equal
deleted
inserted
replaced
2063:9806e44df26f | 2064:10f38996f89a |
---|---|
1 import BaseHTTPServer | 1 import BaseHTTPServer |
2 from os import walk | 2 from os import walk |
3 from os import path | 3 from os import path |
4 from os import listdir | 4 from os import listdir |
5 import inspect | |
6 import os | |
5 import urllib2 | 7 import urllib2 |
6 import pickle | 8 import pickle |
7 import datetime | 9 import datetime |
10 | |
11 # Go to right folder. | |
12 scriptdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # script directory | |
13 os.chdir(scriptdir) # does this work? | |
8 | 14 |
9 PSEUDO_PATH = 'example_eval/' | 15 PSEUDO_PATH = 'example_eval/' |
10 pseudo_files = [] | 16 pseudo_files = [] |
11 for filename in listdir(PSEUDO_PATH): | 17 for filename in listdir(PSEUDO_PATH): |
12 if filename.endswith('.xml'): | 18 if filename.endswith('.xml'): |