Skip to main content

How to obtain the Working Directory of an IDEA's project

Hello everyone!!
Does anyone know how to obtain the working directory of an IDEA's project using python?
I tried the code below but it raised an error " 'str' object is not callable"
import win32com.client as win32ComClient
idea = win32ComClient.Dispatch="Idea.IdeaClient")
wd = idea.WorkingDirectory()

Brian Element Mon, 04/12/2021 - 15:16

Here is the code, your second line where you have the idea = isn't correct and the last line, since it is returning an attribute it doesn't need the ()

import win32com.client as win32ComClient
idea = win32ComClient.Dispatch(dispatch="Idea.IdeaClient")
wd = idea.WorkingDirectory