Уведомления

Группа в Telegram: @pythonsu

#1 Апрель 11, 2014 21:22:37

Aldookar
Зарегистрирован: 2014-04-11
Сообщения: 2
Репутация: +  0  -
Профиль   Отправить e-mail  

Запуск скрипта

Добрый вечер, помогите пожалуйста запустить скрипт…
Какая для него нужна версия 2.7 или 3.4?

init python:
    def unarchive(original_filename, new_filename):
        # original_filename is the name the file has when stored in the archive, including any 
        # leading paths.
        # new_filename is the name the file will have when extracted, relative to the base directory.
        
        import os
        import os.path
        new_filename = config.basedir + "/" + new_filename
        dirname = os.path.dirname(new_filename)
        
        if not os.path.exists(dirname):
            os.makedirs(dirname)
        orig = renpy.file(original_filename)
        new = open(new_filename, "wb")
        from shutil import copyfileobj
        copyfileobj(orig, new)
        new.close()
        orig.close()
        
            
label start:
    # We have Track01.mp3 in archive and images/photo.png in archive too
    
    # This will unarchive Track01.mp3 from archive basedir/extracted path
    $ unarchive("Track01.mp3", "extracted/Track01.mp3")
    
    # This will unarchive photo.png as xxx.png from archive to basedir/extracted path
    $ unarchive("images/photo.png", "extracted/xxx.png")

Офлайн

#2 Апрель 11, 2014 22:00:20

Aldookar
Зарегистрирован: 2014-04-11
Сообщения: 2
Репутация: +  0  -
Профиль   Отправить e-mail  

Запуск скрипта

Спасибо разобрался….

Офлайн

Board footer

Модераторировать

Powered by DjangoBB

Lo-Fi Version