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