我有一个网址列表:
files=[('images',requests.get(image).content),('images',requests.get(image).content),..]
我需要创建另一个列表,如下所示:
('images',requests.get(image).content)
对于图像列表中的每个图像URL,我需要一个<form action="THE PAGE YOU SENT REQUEST" method="POST">
<input placeholder="zoeken" name="zoaken" type="text">
<input type="submit" value="Submit">
</form>
<?php
/* Get the text input with $_POST */
$string = $_POST['zoaken'];
/* Redirect the page to the new address */
header('Location: https://nl.wikipedia.org/wiki/'.$string);
列表。该怎么办?
答案 0 :(得分:1)
听起来像是列表理解工作。
images=['https://example.co/123','https://example.co/124', ...]
files = [('images', requests.get(image).content) for image in images]