0

When working with students I create a repository for each student. Where all homeworks and solutions are committed. I have few start scripts that create folders for each students from names list, then iterate over these folders, create git repos and copy initial files.

Also each repo is conveniently treated as a project. Since I prefer PyCharm I launch the IDE and use Open as a Project command for each student's folder. PyCharm recognizes existing git repo. And then I only need to link the project to the shared virtual environment created earlier. However I can't stop thinking that there is a scriptable way to create these projects.

So, my goal is to automize project creation.

JetBrains docs tells us that we can use PyCharm executable to open any directory. PyCharm will add the .idea directory to it, making it a project, and will open IDE.

This is a good starting point. However there are some questions.

  1. It's not a good idea to launch GUI for each folder in the loop. How to do it silently, only in CLI?
  2. Info about virtual environment is written in misc.xml. Is there a way to explicitly specify the venv I want to use for a project? Or I need to parse down the misc.xml file and rewrite it in my script?

Hope for some help here and suggestions. Thanks!

P.S.: JetBrains also notes some shell scripts for Toolbox App. Sadly, there is almost no more info about it. My own experience was disappointing because of very freaky batch scripts (infinite loops included). Perhaps someone have used it with profit?

Gennadiy
  • 192
  • 10

0 Answers0