Если вы размещаете сервер самостоятельно, и этот сервер оказывается Apache, вы также можете получить эту ошибку, даже если у вас есть uncommented extension=php_mysqli.dll
в php.ini.
Вам также нужно сообщить Apache где найти php.ini с помощью директивы PHPIniDir
в httpad.conf Apache http / etc / f1]
AddHandler application/x-httpd-php .php
PHPIniDir "<path-to-folder-where-php-ini-lives>"
Откройте файл, сохраните его до нового пути, а затем снова откройте новый путь:
def create_new_presentation(templateFileName, outputFileName):
"""
creates a new PPTX file from the template path -- this will OVERWRITE outputFileName if exists.
templateFileName: path to 'template' file
outputFileName: path to the output file
"""
p = Presentation(templateFileName)
p.save(outputFileName)
p = Presentation(outputFileName)
return p
Или вы можете сделать это с помощью shutil.copyfile
:
from shutil import copyfile
def create_new_presentation(templateFileName, outputFileName):
"""
creates a new PPTX file from the template path -- this will OVERWRITE outputFileName if exists.
templateFileName: path to 'template' file
outputFileName: path to the output file
"""
copyfile(templateFileName, outputFileName)
return Presentation(outputFileName)