You can loop over the dataframe df
using iterrows()
and then access filename
and password
in following way. There is no need of nested loops.
import pikepdf as pdf
import pandas as pd
df = pd.read_csv('filePassword.csv')
for index, row in df.iterrows():
file1 = pdf.open(row['filename'], row['password'])
file1.save('1_'+row['filename'])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…