# HG changeset patch # User Brecht De Man # Date 1435949412 -3600 # Node ID 10f38996f89adac611ebbb0ccbfc077a9611a18e # Parent 9806e44df26fe987d1dc9ea22122cbf739d12ac9 Automatically go to right folder when running server locally so you can drag and drop the script in Terminal (after typing 'Python'). diff -r 9806e44df26f -r 10f38996f89a 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):