Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6880 Lượt xem

Hi,

  • I want to create a folder inside the Odoo folder using python function( ie, inside Odoo-12.0 )

  • for this, I imported the os, and find the path. If the path didn't exist I want to create a folder as the path describes. but when this runs it shows an error like,

    PermissionError: [Errno 13] Permission denied '/certificates'
    My code is given below. Please Help

import os
path = str(pathlib.Path(__file__).parent.absolute()) + "/certificates"
is_file = os.path.exists(path)
if not is_file:
os.mkdir(path)
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello,

Please run the following command to show the access rights on the folder where you want to create the new folder.

ls -l path/to/folder

Check if you have the write permission on that folder. If not, please run the following command:

sudo chmod +w path/to/folder

Good luck.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 24
2069
1
thg 11 15
4998
2
thg 2 24
1181
1
thg 10 23
7834
2
thg 9 21
10650