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
|
#!/usr/bin/env python
import os
import sys
import math
ROOT = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(ROOT, '..'))
from pygooglechart import QRChart
import settings
import helper
def hello():
# Create a 250x250 QR chart
chart = QRChart(250, 250)
# Add the text
chart.add_data('Hello, World!')
# "Level H" error correction with a 0 pixel margin
chart.set_ec('H', 0)
# Download
chart.download('qr-hello.png')
def main():
hello()
if __name__ == '__main__':
main()
|