Использование файла PowerPoint с существующим шаблоном

Если вы размещаете сервер самостоятельно, и этот сервер оказывается 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>"
-2
задан K. Abhulimen 13 July 2018 в 13:40
поделиться

1 ответ

Откройте файл, сохраните его до нового пути, а затем снова откройте новый путь:

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)
1
ответ дан David Zemens 17 August 2018 в 12:42
поделиться
Другие вопросы по тегам:

Похожие вопросы: