Answer the question
In order to leave comments, you need to log in
How to integrate Python into a website?
I have a WordPress site, what is the easiest way to integrate Python code
import httplib2
import apiclient.discovery
from oauth2client.service_account import ServiceAccountCredentials
FirstName, LastName = input().split(' ')
range='A1:N10000'
CREDENTIALS_FILE = 'creds.json'
spreadsheet_id = '1LlrsWpwBpqBowqgvbNFr7wwZfwGtzqAldQrW668k9bY'
credentials = ServiceAccountCredentials.from_json_keyfile_name(
CREDENTIALS_FILE,
['https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/drive'])
httpAuth = credentials.authorize(httplib2.Http())
service = apiclient.discovery.build('sheets', 'v4', http = httpAuth)
values = service.spreadsheets().values().get(
spreadsheetId=spreadsheet_id,
range=range,
majorDimension='ROWS'
).execute()
for i in values['values']:
if FirstName == i[2] and LastName == i[3]:
print("Date: " + i[0] + "\nDomain: " + i[1] + "\nFirst Name: " + i[2] + "\nLast Name: " + i[3] + "\nDate of birth: " + i[4] +
"\nAddress: " + i[5] + "\nApt./Suite: " + i[6] + "\nCity: " + i[7] + "\nZIP: " + i[8] + "\nEmail: " + i[9] + "\nPhone number: " + i[10]
+ "\nSymptoms or conditions: " + i[11] + "\nOther information: " + i[12] + "\nLink on photo: " + i[13])
Answer the question
In order to leave comments, you need to log in
the simplest thing is to rewrite the code in php.
and crossing a grass snake with a viper is a so-so idea. though nothing is impossible.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question