Skip to content

Instantly share code, notes, and snippets.

@VedantParanjape
Last active April 13, 2020 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VedantParanjape/8bc28f508bb8c83711614504b25ebfb5 to your computer and use it in GitHub Desktop.
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
# 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