[Python] Using the escape function to concatenate the title with the colors together to show...

Discussão em 'Python' iniciado por Stack, Dezembro 1, 2024.

  1. Stack

    Stack Membro Participativo

    I am having issue to concatenate the title with the colors in this form ( " Title (color, color, color)" ). Script works great with "Title": escape ((title)) but now when adding (coloror)) I get this error
    "Title": escape ((title) (coloror)) , TypeError: 'str' object is not callable "

    Script is long, Snippet of script:

    print('Title: ',title)
    # Print the extracted data
    for data in product_data:
    print(f"Color: {data['color']}")
    print(f"Price: {data['price']}")
    print(f"Width: {data['width']}")
    print(f"Image URL: {data['image_url']}")
    print(f"Available Sizes: {', '.join(data['sizes'])}")
    print(f"ror: {data}")
    print("-" * 50)

    coloror = ', '.join(data['color'] for data in product_data)


    item = {
    "Item": {
    "Title": escape ((title) (coloror))


    I don't have much experience with Python.

    Continue reading...

Compartilhe esta Página