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内容请搜索靠谱客的其他文章。
发表评论 取消回复