Automate excel in python sequence

Asked

Viewed 62 times

0

In a google form that transforms all filled data in excel spreadsheet, I did in python a programming that copies the data of the first line and fills a form I need. There is the possibility of this program to read the line below and fill in a next form?

    Planilha formulario.xlsx 
    NOME   IDADE  
  0  Joao    40 
  1  Maria   30 
  2  José    20
import pandas as pd

formulario = pd.read_excel(r'C:\formulario.xlsx', sheet_name='Planilha1')

nome, idade = formulario['NOME][0], str(formulario['IDADE'][0]

print(nome)
print(idade)

Today I need to run the program every time to fill in the data from the excel line 0, and at the end, copy the line 1 to zero and so on. It is possible I create an input where the program before starting ask me from which excel line I want to fetch the information?

  • Yes, there are numerous possibilities. You can search on the function input python, for example. Or search how to create command line applications with Python.

  • see python for loop

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.