I am really new in Python.
I have made a python program for merging pdfs. The problem is when the program want to save the completed merged pdf on the server (at work), it doesn't work. I get an Error: Permission denied
. But when I say to my program that the merged pdf file must be saved on a local folder (on my pc), it works perfectly. How can I fix this?
An example of pathpdflocation_compleet
(local on my pc) :
C:\Users\myname\Documents\TF\Compleet\pdfcompleet.pdf
An example of pathpdflocation_compleet
(at work) :
W:\xxx\xxx\xxx\xx\pdfcompleet.pdf
Can I give my python script permission for saving this pdf file on the server?
I have searched on the web, but I don't find anything about this. I have already tried with double backslashes and / or \. I have already tried to give the full name of the server.
'''
python
'''
from PyPDF2 import PdfFileMerger
from openpyxl import load_workbook
filepath=input ('Path of the Merge Excel: ')
wb=load_workbook(filepath,data_only = True)
fiche1="A1"
file1=sheet[fiche1].value
fiche2="A2"
file2=sheet[fiche2].value
pdf2merge = [file1,file2,...]
merger = PdfFileMerger()
for pdf in pdf2merge:
merger.append(pdf)
with open(pathpdflocation_compleet, 'wb') as fout:
merger.write(fout)
The error is this:
IOError: [Errno 13] Permission denied
I want the file to be saved on the server.