'Python script... I need to take API Key from the command prompt into Main.py
Need help to take an API key from the command prompt and insert it into a particular cell of an excel sheet. I plan to add it into Main.py. but not sure where in the script.
API_key = input("What is the API key? \n")
Then I plan to use Openpyxl to add this into the cell on the excel sheet. But where do I add this code? In the Main.py script? Taken directly from the Openpyxl docs:
from openpyxl import Workbook
wb = Workbook()
# grab the active worksheet
ws = wb.active
# Data can be assigned directly to cells
ws['A1'] = API_key
# Save the file
wb.save("sample.xlsx")
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
