小编Kar*_*ran的帖子

我想在使用 css 在 html 中单击时更改按钮的内部数据

在单击按钮时, func() 正在由 javascript 执行,但我希望在单击按钮时更改内部内容...

例如,当我单击按钮时,内容“暂停”应显示“开始”,再次单击“开始”时,内容应显示“暂停”

我希望我很清楚,请有人帮助我。:)

<button class="button1" onclick="func()">Pause</button>
Run Code Online (Sandbox Code Playgroud)

html javascript css

2
推荐指数
1
解决办法
74
查看次数

如何在内存中创建包含多个文件和子文件夹的 zip 存档?

以下命令运行,但导致文件解压失败:

import io
import zipfile

b = io.BytesIO()
zf = zipfile.ZipFile(b, mode='w')
zf.writestr('a/b.txt', 'look here')
zf.writestr('a/c.txt', 'look there')
open('here.zip', 'wb').write(b.getbuffer())
Run Code Online (Sandbox Code Playgroud)

然后测试:

$ unzip here.zip
Archive:  here.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of here.zip or
        here.zip.zip, and cannot find …
Run Code Online (Sandbox Code Playgroud)

python zip python-zipfile

2
推荐指数
1
解决办法
3073
查看次数

标签 统计

css ×1

html ×1

javascript ×1

python ×1

python-zipfile ×1

zip ×1