Project Directory Variable


Is there a variable I can use for project directory when inputting custom scripts and it asks for the Working Directory?


Up ! I'm also looking for project variables i could use in my run configurations settings like Visual Studio has : $(ProjectDir) or $(OutDir)


I just noticed by looking at the configuration xml file that Pycharm replaced my project path with $PROJECT_DIR$. But i can't use it directly on my script path...

I mean the feature is there, but you don't let us use it...


When you create a file watcher configuration, you have a number of variables to use. For example you can set the working directory via $FileDir$.

I think we are just looking to use those type of variables in the run configurations. Specifically I'd like to have a default ruby configuration with my desired options that would use the project path when I create an instance of that configuration.


@Olga: Thanks for the link, but it's to a long page so it's hard to see what you're referring to specifically.

I believe what's actually being requested here is a way to access JetBrains settings variables, e.g. the project directory. This would include system environment variables, e.g. $HOME, but they're not what's being asked for here specifically.

Personally, right now, in PyCharm, I'm setting Run→Edit Configurations…→[my project]→Logs→Add→Log File Location, and it's asking me to pick a path. There are handy buttons for picking the project root path, but that path is what ends up getting saved to the configuration file. Therefore, if the project moves, the configuration will break. It would therefore be nice if we could enter something like '${project_dir}/foo.log', so everything keeps working, even if we move the project.

While I don't think it's the best implementation, Eclipse offers this funtionality: It's something I miss in PyCharm.


I am also looking for a variable where I can use it to dynamically reference the project root directory.  I would like to use it in run configuration and also in many other places, like Settings -> Appearance & Behavior -> Scopes.


We have a similar request regarding more variables so it'd be great if your could add your vote there: