emonSDexpand

Hi, I would like to suggest a small change.

echo " SD card total disk size = "$(python -c "print**(**$PART_END * 512.0 / 1073741824**)**")"Gb"
echo " Data Partition size     = "$(python -c "print**(**($DATA_END - $DATA_START + 1) * 512.0 / 1073741824**)**")"Gb"

I read this post on stackoverflow What does "SyntaxError: Missing parentheses in call to 'print'" mean in Python? - Stack Overflow

Hi welcome.

Best to add this as a change on GitHub and say why :slight_smile:

Sorry, yesterday was very late and today too.
Yesterday I downloaded new emonSD image and I flashed it in a 32GB micro SD for a raspberry 2.
When I tried to execute emonSDexpand I received this message:

SyntaxError: Missing parentheses in call to 'print'

or similar. I don’t have an exact copy of error.
So I tried to modify emonSDexpand script. I finded 2 rows that use “print”. I added 2 parenthesis and bug was solved.

Now I notice that my previous post not show which is the solution.

Previous:

echo " SD card total disk size = "$(python -c "print $PART_END * 512.0 / 1073741824")"Gb"
echo " Data Partition size     = "$(python -c "print ($DATA_END - $DATA_START + 1) * 512.0 / 1073741824")"Gb"

Resolved:

echo " SD card total disk size = "$(python -c "print($PART_END * 512.0 / 1073741824)")"Gb"
echo " Data Partition size     = "$(python -c "print(($DATA_END - $DATA_START + 1) * 512.0 / 1073741824)")"Gb"

I searched script on GitHub but I didn’t find it.

Took me a while to find it.

I’m astonished this still works TBH.

Another pre Python3 script.

Well, now what can I do? I don’t know how to require a changed. I have to open an Issue?

That is the simplest way.

Once you made the change did it work?

Just to note, by making the change, future updates may get blocked by git. You need to review the update log to check there are no errors after you have updated.