从csv文件特定行开始读取数据

num = 0
with open('dalian_all.csv', 'rt', encoding='gbk') as csvfile:

    reader = csv.DictReader(csvfile) 
    
    for line in reader:#逐行读取csv文件
    
        num += 1 #每读一行,num+1
        
        #从第45行开始读取数据url
        if num > 44:

            urls = [row['url'] for row in reader]

            for url in urls:

                print(url)

你可能感兴趣的:(Python)