Advertisement
ba5tz

GSheet for VBA

Jun 28th, 2019
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. import gspread
  2. from oauth2client.service_account import ServiceAccountCredentials
  3. import pprint
  4. import sys
  5.  
  6. scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
  7. creds = ServiceAccountCredentials.from_json_keyfile_name('API Project-file-disini.json', scope)
  8. client = gspread.authorize(creds)
  9.  
  10. sheet = client.open('CRUD_Excel').sheet1
  11.  
  12. def UpdateX(ID,Nama):
  13.     print("Updating")
  14.     sheet.append_row([ID,Nama])
  15.    
  16. if __name__== "__main__":
  17. UpdateX(sys.argv[1], sys.argv[2])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement