Feature #1321

pythonServer script to automatically go to test folder

Added by Brecht De Man about 9 years ago.

Status:In ProgressStart date:2015-07-03
Priority:NormalDue date:
Assignee:Nicholas Jillings% Done:

50%

Category:-
Target version:-

Description

I tweaked the pythonServer.py script (see repo) so that you can drag and drop the script rather than having to go to the test folder first in Terminal (Mac OS X).
This is mostly aimed at less computer-savvy users who may get discouraged from having to type 'cd', figuring out the directory and so on. Now they just have to type 'python ' and drag the folder there.

In Windows you can just double click the script or so it seems.

Code I added (please check it doesn't break other things):

import inspect
import os

# Go to right folder.
scriptdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) # script directory
os.chdir(scriptdir) # does this work?

Also available in: Atom PDF