[Python] How to force a string to stay a string and not be converted to a date ? - Python

Discussão em 'Python' iniciado por Stack, Abril 12, 2025.

  1. Stack

    Stack Membro Participativo

    I'm facing an issue while pushing data into Excel using Python. I need to write a string like "4/10" to a cell, but Excel automatically converts it into a date. However, "4/10" is not a date in my case — it's the name of a material, and it must stay exactly as "4/10". I'm using pandas, xlwings, and openpyxl. How can I force Excel to treat the value as a plain string and prevent it from being converted into a date? Thanks in advance! i tried str() and some other things, but didn't workde

    Continue reading...

Compartilhe esta Página