Задать вопрос
  • Как скачать фото по списку ссылок с указанными именами?

    alsolovyev
    @alsolovyev
    ¯\_(ツ)_/¯ Enjoy life, Eat well & Laugh often
    Допустим (если нет заголовков)
    pip install pandas openpyxl

    import pandas as pd
    import os
    
    def parse_excel(file_path):
        # Read the Excel file
        df = pd.read_excel(file_path, header=None)
    
        # Loop through each row in the DataFrame
        for index, row in df.iterrows():
            name = row[0]
            link = row[1]
    
            # Extract the file extension from the link
            file_extension = os.path.splitext(link)[1]  # Get the extension, e.g., .jpg
    
            # Form the new filename
            new_filename = f"{name}{file_extension}"
    
            # Output the new filename
            print(new_filename)
    
    
    # Example usage
    parse_excel("test.xlsx")
    Ответ написан
    Комментировать