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

3 posts / 0 new
Last post
jsandoval
Offline
Joined: 03/01/2021 - 10:48
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's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
jsandoval
Offline
Joined: 03/01/2021 - 10:48

Thank you!! it worked perfectly