[Tutor] Ideas about global variables for accessing project's file

Alan Gauld alan.gauld at btinternet.com
Wed Jan 12 14:59:07 CET 2011


"Kann Vearasilp" <vearasilp at gmail.com> wrote

> Is there a way to make a global variable for the project to make my 
> life
> easier? Sometime like... PROJECT_PATH/src/modules/mod1 which 
> PROJECT_PATH
> should work with every machines.

You can use a relative path based on your installatiojn root
You can use a config file that the user edits to specify the root 
directory
You can use an environment variable to specify the root directory

If you are working with Windows you could also use a registry entry to
store the root.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list