I was working on a selenium project that works with google drive api and google sheets but I needed to run my project as a .exe file so I converted it with pyinstaller and it worked well but when I tried to move it to another PC, with a different gmail account, and entered a new google sheet name and worksheet name, it didn't recognize them, but recognized the old files from the past email, how come? In other words, which account will selenium see, the default or the current?
import gspread
from oauth2client.service_account import ServiceAccountCredentials
def sheet_access(sheet_name, worksheet_name):
scope = ['https://www.googleapis.com/auth/spreadsheets', "https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive"]
creds = ServiceAccountCredentials.from_json_keyfile_name('client_secret.json', scope)
client = gspread.authorize(creds)
sheet = client.open(sheet_name).worksheet(worksheet_name)
return sheet