概述
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 for循环中一次运行3个变量。所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复