Skip to content

vashukarn/automated-qr-code-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

automated-qr-code-generator

N|Solid

Build Status

General Information

This script helps to automate browser using selenium to generate QR codes taking data from CSV file. It is a python automated script that creates QR codes according to the data provided in CSV file at once. I used the selenium web browser to generate QR codes.

Prerequisites

These should run without any error:

  • All modules according to requirements
pip install -r requirements.txt
  • Chrome webdriver should be installed
  • Path of Chrome Browser should be added to PATH
  • Make sure the file is in csv format (If not you can change your file into csv using some available online tools.)
  • Name should be entered along with the .csv extension
from selenium import webdriver
import time
import csv

Taking data from CSV Files

def sheet(sheet):
    file = open(sheet, mode='rt')
    reader = csv.reader(file)
    rownum = 0
    val = []
    for row in reader:
        # Save header row.
        if rownum == 0:
            header = row
        # save other data
        else:
            val.append(row)
        rownum += 1

    file.close()
    return (header, val)

We enter data using two for loops as we have taken data into two lists : Topic and Value

for i in range(len(value)):
        for j in range(len(topic)):
            if (j == 0):
                data = str(topic[j]) + ' : ' + str(value[i][j])
            else:
                data = data + '\n' + str(topic[j]) + ' : ' + str(value[i][j])

If you want to go headless just uncomment these two lines

chrome_options.add_argument('--headless')
chrome_options.add_argument('--disable-gpu')

License:

MIT

Free Software, Hell Yeah!

About

This script helps automating browser using selenium to generate qr codes taking data from csv file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages