我是靠谱客的博主 寂寞未来,最近开发中收集的这篇文章主要介绍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 for循环中一次运行3个变量。所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部