我是靠谱客的博主 寂寞未来,这篇文章主要介绍python一次性输入3个数,在python for循环中一次运行3个变量。,现在分享给大家,希望可以做个参考。

For loop with multiple variables in python 2.7.

Hello,

I am not certain how to go about this, I have a function that goes to a site and downloads a .csv file. It saves the .csv file in a particular format: name_uniqueID_dataType.csv. here is the code

import requests

name = "name1"

id = "id1"

dataType = "type1"

def downloadData():

URL = "http://www.website.com/data/%s" %name #downloads the file from the website. The last part of the URL is the name

r = requests.get(URL)

with open("data/%s_%s_%s.csv" %(name, id, dataType), "wb") as code: #create the file in the format name_id_dataType

code.write(r.content)

downloadData()

The code downloads the file and saves it perfectly fine. I want to run a for loop on the function that take

最后

以上就是寂寞未来最近收集整理的关于python一次性输入3个数,在python for循环中一次运行3个变量。的全部内容,更多相关python一次性输入3个数,在python内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(135)

评论列表共有 0 条评论

立即
投稿
返回
顶部