Last active
April 13, 2020 16:52
-
-
Save VedantParanjape/8bc28f508bb8c83711614504b25ebfb5 to your computer and use it in GitHub Desktop.
Script to generate students passport size pics with file name as their college id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reading an excel file using Python | |
import xlrd | |
import os | |
# Give the location of the file | |
loc = ("form.xlsx") | |
# To open Workbook | |
wb = xlrd.open_workbook(loc) | |
sheet = wb.sheet_by_index(0) | |
# For row 0 and column 0 | |
for i in range(1,3): | |
sign = sheet.cell_value(i,5)[33:] | |
photo_pp = sheet.cell_value(i,4)[33:] | |
c3 = 'wget -O ' + 'Photos/' + str(int(sheet.cell_value(i,3))) + '_p.jpg' + ' ' + '"' + 'https://drive.google.com/uc?export=download&id=' + sign + '"' | |
c4 = 'wget -O ' + 'Signature/' + str(int(sheet.cell_value(i,3))) + '_s.jpg' + ' ' + '"' + 'https://drive.google.com/uc?export=download&id=' + photo_pp + '"' | |
os.system(c4) | |
os.system(c3) | |
i += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment