我正在打开一个包含链接的 .csv 文件,并且我想导航到每个链接。但是当我打印链接列表时,它周围有括号和单引号。如何打印没有括号和单引号的链接?
import csv
import os
with open('links.csv', 'r') as f:
reader = csv.reader(f)
links = list(reader)
for i in links:
print(i)
结果
['https://links.com/100GLC-PFAQ-6X9?idc=43']
['https://links.com/100GLC-PFAQ-9X12?idc=43']
['https://links.com/100LB-PFLIN-9X12?idc=43']
['https://links.com/14PT-PFUV-5.25X10.5?idc=43']
['https://links.com/14PT-PFUV-6X9?idc=43']
['https://links.com/14PT-PFUV-9X12?idc=43']
更新 我使用 *. 下面是我更新的代码。
import csv
import os
with open('links.csv', 'r') as f:
reader = csv.reader(f)
links = list(reader)
for i in links:
print(*i)