0

My python script execute another script

os.system(r'C:\Users\b039434\PycharmProjects\consulta_fdc\Exportar_Dados2.acsup')

the last thing this script("Exportar_Dados2.acsup") does is copy the data to clipboard,

after that I need to paste into an excel.

When I paste manualy using CTRL+V it works

I need something to paste the data from my clipboard to an Excel sheet, the data is something like a table, that comes from another software, something with a delimiter and many rows.

Pedro Roque
  • 1
  • 1
  • 2
  • probably this can help you https://stackoverflow.com/questions/101128/how-do-i-read-text-from-the-windows-clipboard-from-python – GiovaniSalazar Jan 10 '20 at 19:31
  • The simplest thing to do may actually be to write an AutoHotkey script to open the Excel sheet and paste into it. (You can then call that script using Python like you did with your `Exportar_Dados2.acsup` script.) However, if you're generating the Excel sheet from scratch, you could also use the idea from @GiovaniSalazar together with a package like XlsxWriter to do more of the work in Python. – John Y Jan 10 '20 at 22:05

0 Answers0