-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathissue.py
More file actions
47 lines (33 loc) · 855 Bytes
/
issue.py
File metadata and controls
47 lines (33 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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('12345.json',scope)
client = gspread.authorize(creds)
sh = client.open('abhishek')
sheet = sh.get_worksheet(0)
r = 5
c = 4
#id = 123456789
#name = "Parth Kothari"
#row = 2
#col = 2
print("Scan The Barcode")
bno = float(input())
print("Issue To ")
issue = raw_input()
#status = "Available"
#row = [bno,n,desc,status]
#index = 2
#sheet.insert_row(row,index)
#row = 2
#col = 2
def search():
for i in range(2,r+1):
k = 1
a = sheet.cell(i,k).value
if(bno == int(a)):
sheet.update_cell(i ,4 ,"Issued To " +issue)
return
search()
print("Sheet Updated")