# Revision history [back]

I'm trying this code in my plugin:

app = wingapi.gApplication
app.ExecuteCommand('new-project') prj = app.GetProject()
prj_filename = prj.GetFilename() prj_dir, prj_name = os.path.split(prj_filename) print('DIR', prj_dir, 'NAME', prj_name)

The new-project command is nice since it may work interactively and create all the initial stuff. Especially, the end use can select the folder and the project name from dialogs. However, I do not understand why the prj.GetFilename does not return the filename of the newly created project. I need a way to know the folder and name after creation.

I'm trying this code in my plugin:

app = wingapi.gApplication
app.ExecuteCommand('new-project')
prj = app.GetProject()
prj_filename = prj.GetFilename()
prj_dir, prj_name = os.path.split(prj_filename)
print('DIR', prj_dir, 'NAME', prj_name)prj_name)


The new-project command is nice since it may work interactively and create all the initial stuff. Especially, the end use can select the folder and the project name from dialogs. However, I do not understand why the prj.GetFilename does not return the filename of the newly created project. I need a way to know the folder and name after creation.