Permission denied error while writing to a file in Python

后端 未结 9 1874
萌比男神i
萌比男神i 2020-12-17 08:48

I want to create a file and write some integer data to it in python. For example, I have a variable abc = 3 and I am trying to write it to a file (which doesn\'t exist and I

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-17 09:35

    If you are executing the python script via terminal pass --user to provide admin permissions.

    Worked for me!

    If you are using windows run the file as admin.

    If you are executing via cmd, run cmd as admin and execute the python script.

提交回复
热议问题