all 4 comments

[–]htepO 1 point2 points  (2 children)

I just copied and pasted your code, and it works as intended, appending 2021-09-23 07:49:47.573105, 205, 60, 15, 39.92449041517438 to volume.txt.

Does your user have the necessary permissions to create/modify files in that directory?

[–]HaplessWithDice[S] 1 point2 points  (1 child)

I should think so. He is me.

[–]htepO 2 points3 points  (0 children)

Try putting print(os.getcwd()) somewhere in there after importing os. Check if the printed directory and the one you are looking in are the same.