Jun-14-2019, 07:28 PM
I have a series of python scripts that enter data into a Google sheets column. I want to jump over to the next empty column if I run everything the next day. Here's a simple version of what I've got - it just puts today's date into cell A1.
I found these related examples, but I think they're for javascript. (I'm a noon at this)
https://webapps.stackexchange.com/questi...ati/101200
https://webapps.stackexchange.com/questi...fic-column
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
creds = ServiceAccountCredentials.from_json_keyfile_name('client_penny.json', scope)
client = gspread.authorize(creds)
from datetime import datetime
date = datetime.today().strftime('%Y-%m-%d')
penny = client.open('pennystocks').worksheet('DGTW')
penny.update_acell('A1', date)I want the date to go into B1 if I run it tomorrow (or whatever the next available column is if I've already run it a few times).I found these related examples, but I think they're for javascript. (I'm a noon at this)
https://webapps.stackexchange.com/questi...ati/101200
https://webapps.stackexchange.com/questi...fic-column
