# HG changeset patch # User Brecht De Man # Date 1435949412 -3600 # Node ID ca2f200f37be2714937de3336ec7275960c58a39 # Parent a2800d0b56566891c33240fade905eddc7b0be3c Automatically go to right folder when running server locally so you can drag and drop the script in Terminal (after typing 'Python'). diff -r a2800d0b5656 -r ca2f200f37be pythonServer.py --- a/pythonServer.py Thu Jul 02 15:44:35 2015 +0100 +++ b/pythonServer.py Fri Jul 03 19:50:12 2015 +0100 @@ -2,10 +2,16 @@ from os import walk from os import path from os import listdir +import inspect +import os import urllib2 import pickle import datetime +# Go to right folder. +scriptdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # script directory +os.chdir(scriptdir) # does this work? + PSEUDO_PATH = 'example_eval/' pseudo_files = [] for filename in listdir(PSEUDO_PATH):