0

Project Managament with CircuitPython
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Project Managament with CircuitPython

by adrenth on Tue Dec 26, 2017 3:03 pm

Hello,

Does anyone have a way to easily manage multiple projects? The use case I am working with is having several classes using the metro M0 boards and I would like to be able to have the students work through different projects. They need to be to easily organize them on their computer while also being able to upload to the board. These students are in Grade 9, so simply copy the code and save elsewhere would be problematic from the start. Mu looks great but its only really good to handle one project as a time. I can see a student easily getting confused which code.py they should be working with. PyCharm seems to have some support is this area (and its the IDE I use to teach the Python language), however I'm having trouble figuring out the setup to create essentially two versions of a file: One locally on the computer, the other uploaded onto the board when I want it to run.

Any ideas or I am just asking for the moon?

adrenth
 
Posts: 1
Joined: Tue Dec 26, 2017 2:53 pm

Re: Project Managament with CircuitPython

by danhalbert on Tue Dec 26, 2017 3:55 pm

Someone suggested an Atom plugin that would write a file both to CIRCUITPY and to a directory on the host computer. The original idea was for backup (in case CIRCUITPY got corrupted), but perhaps it could also be a project management tool. The plugin could write to a project dir and directly to CIRCUITPY. Such a plugin could be written for Atom, PyCharm, VSCode, or similar editors with an add-on ability.

For now, you could have multiple folders on CIRCUITPY, one per project. Each would contain a code.py which you could copy to the top level as needed. You'd have to emphasize copy, rather than move. I myself have some backup directories named CIRCUITPY-someproject, CIRCUITPY-anotherproject, etc. I just copy over everything on CIRCUITPY as necessary.

At some point we also talked about not just looking for code.py to run automatically , but looking for code-*.py, and picking the first one found. Then the file is self-identifying by name. However, this feature seemed kind of complicated, and ultimately we didn't go further with it.

Does this give you some ideas? Happy to brainstorm further.

danhalbert
 
Posts: 1175
Joined: Tue Aug 08, 2017 12:37 pm

Re: Project Managament with CircuitPython

by devinganger on Fri Dec 29, 2017 7:23 am

It's too bad that the default file it looks for isn't simply a "pointer" text file that contains the name of the .py file to run. That way you could keep multiple files on the device and simply change the filename in the pointer.

devinganger
 
Posts: 62
Joined: Tue Aug 09, 2016 1:09 am

Re: Project Managament with CircuitPython

by danhalbert on Fri Dec 29, 2017 9:36 am

@devinganger: you can do this with just pure Python: just make code.py or main.py be the single statement:

Code: Select all | TOGGLE FULL SIZE
import myprogram


and have a file myprogram.py. Change the name as you wish. The code in myprogram.py will get run when code.py runs.

danhalbert
 
Posts: 1175
Joined: Tue Aug 08, 2017 12:37 pm

Re: Project Managament with CircuitPython

by devinganger on Sat Dec 30, 2017 1:08 am

Well, that would be the answer then -- a nifty workaround to use immediately.

devinganger
 
Posts: 62
Joined: Tue Aug 09, 2016 1:09 am

Please be positive and constructive with your questions and comments.