1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Excel File Appears Empty After Writing with openpyxl in Python

Discussão em 'Python' iniciado por Stack, Setembro 12, 2024.

  1. Stack

    Stack Membro Participativo

    Hello I write some code in Python using the openpyxl library and the code looks fine but when I run the code and there are no errors but when I open the excel file is showing nothing.

    import openpyxl

    path = "python_try.xlsx"

    workbook = openpyxl.Workbook()
    workbook.save(filename=path)
    wb = openpyxl.load_workbook(path)

    sheet = wb.active

    x1 = sheet.cell(row=1, column=1)
    x1.value = "is work"

    workbook.save(path)


    and here is a pic from the excel after running the code enter image description here

    I'm expecting answers and thanks for all the help.

    Continue reading...

Compartilhe esta Página