Skip to content
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.

QR code creation fails when using / characters (as in a URL) #2

Open
tomswartz07 opened this issue Jan 25, 2011 · 0 comments
Open

QR code creation fails when using / characters (as in a URL) #2

tomswartz07 opened this issue Jan 25, 2011 · 0 comments
Assignees
Labels

Comments

@tomswartz07
Copy link

I wrote an incredibly simple program to input text and URLs from a file, parsed by the program, passed to pygooglechart, and then downloaded.

upon encountering a text file with a 'forward slash', the program crashes, apparently recognizing the text as a unix file path.

My program code:

!/usr/bin/python

import os
import math
import sys
from pygooglechart import QRChart
ROOT = os.path.dirname(os.path.abspath(file))
sys.path.insert(0, os.path.join(ROOT, '..'))
text_file = open("urls.txt", "r")
lines = text_file.readlines()
print lines
print len(lines)
for line in lines:
print line
# Chart size
chart = QRChart(400,400)
# Chart text
chart.add_data(line)
# Set level of error correction, and 0 pixel margin
chart.set_ec('H',0)
# Download final image
chart.download(line +".png")
text_file.close()

@ghost ghost assigned gak Sep 26, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants