Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
objQRcode
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thorfin89
objQRcode
Commits
a4afe82e
Commit
a4afe82e
authored
Dec 25, 2023
by
Thorfin89
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Affichage des erreurs
parent
78c5b98b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
README.md
README.md
+2
-2
main.py
main.py
+19
-8
No files found.
README.md
View file @
a4afe82e
### objQR
c
ode
### objQR
C
ode
Utilitaire pour créer des QR
c
ode écrit en python.
Utilitaire pour créer des QR
C
ode écrit en python.
Ce projet est au tout début de son développement.
Ce projet est au tout début de son développement.
...
...
main.py
View file @
a4afe82e
# Utilitaire pour création de QR
c
ode
# Utilitaire pour création de QR
C
ode
# Auteur : Daniel SAZERAT
# Auteur : Daniel SAZERAT
# Projet initié le 24/12/2023
# Projet initié le 24/12/2023
from
tkinter
import
*
from
tkinter
import
*
import
qrcode
import
qrcode
from
qrcode.constants
import
ERROR_CORRECT_M
from
qrcode.constants
import
ERROR_CORRECT_M
from
PIL
import
Image
from
PIL
import
Image
# ===== FONCTIONS =====
# ===== FONCTIONS =====
def
new_file
():
def
new_file
():
...
@@ -20,6 +22,7 @@ def sel():
...
@@ -20,6 +22,7 @@ def sel():
def
create_code
():
def
create_code
():
if
texte
.
get
()
!=
""
:
if
texte
.
get
()
!=
""
:
erreur
(
""
)
global
logo
global
logo
qr
=
qrcode
.
QRCode
(
qr
=
qrcode
.
QRCode
(
version
=
3
,
version
=
3
,
...
@@ -33,14 +36,22 @@ def create_code():
...
@@ -33,14 +36,22 @@ def create_code():
img
.
save
(
'qrcode.png'
)
img
.
save
(
'qrcode.png'
)
logo
=
PhotoImage
(
file
=
"qrcode.png"
)
logo
=
PhotoImage
(
file
=
"qrcode.png"
)
logovisu
.
config
(
image
=
logo
)
logovisu
.
config
(
image
=
logo
,
bg
=
"white"
)
img
=
Image
.
open
(
"qrcode.png"
)
img
=
Image
.
open
(
"qrcode.png"
)
size
=
img
.
size
size
=
img
.
size
print
(
size
)
logovisu
.
place
(
x
=
200
-
size
[
0
]
//
2
,
y
=
200
-
size
[
1
]
//
2
)
logovisu
.
place
(
x
=
200
-
size
[
0
]
//
2
,
y
=
200
-
size
[
1
]
//
2
)
else
:
else
:
print
(
"Pas de texte à coder"
)
erreur
(
"Il n'y a pas de données à coder"
)
def
erreur
(
message
):
error_label
=
Label
(
saisie
)
if
message
!=
""
:
error_label
.
config
(
bg
=
"lightgray"
,
fg
=
"red"
,
text
=
message
)
else
:
error_label
.
config
(
bg
=
"lightgray"
,
fg
=
"lightgray"
,
text
=
"======================================"
)
error_label
.
place
(
x
=
390
,
y
=
10
)
# création de la fenêtre principale
# création de la fenêtre principale
...
@@ -75,10 +86,10 @@ root.config(menu=menuBar)
...
@@ -75,10 +86,10 @@ root.config(menu=menuBar)
# ===== FRAMES =====
# ===== FRAMES =====
conf
=
Frame
(
root
,
bg
=
"lightgray"
)
conf
=
Frame
(
root
,
bg
=
"lightgray"
)
conf
.
place
(
x
=
0
,
y
=
0
,
width
=
40
0
,
height
=
400
)
conf
.
place
(
x
=
0
,
y
=
0
,
width
=
38
0
,
height
=
400
)
visu
=
Frame
(
root
,
bg
=
"gray"
)
visu
=
Frame
(
root
,
bg
=
"gray"
)
visu
.
place
(
x
=
401
,
y
=
0
,
width
=
400
,
height
=
400
)
visu
.
place
(
x
=
380
,
y
=
2
0
,
width
=
400
,
height
=
400
)
saisie
=
Frame
(
root
,
bg
=
"lightgray"
)
saisie
=
Frame
(
root
,
bg
=
"lightgray"
)
saisie
.
place
(
x
=
0
,
y
=
401
,
width
=
800
,
height
=
240
)
saisie
.
place
(
x
=
0
,
y
=
401
,
width
=
800
,
height
=
240
)
...
@@ -109,10 +120,10 @@ label.place(x=10, y=10 + 5 * ESP)
...
@@ -109,10 +120,10 @@ label.place(x=10, y=10 + 5 * ESP)
# bouton de création du QRCode
# bouton de création du QRCode
create_Btn
=
Button
(
conf
,
text
=
"Créer le Code"
,
bg
=
"lightgreen"
,
command
=
create_code
)
create_Btn
=
Button
(
conf
,
text
=
"Créer le Code"
,
bg
=
"lightgreen"
,
command
=
create_code
)
create_Btn
.
place
(
x
=
2
8
0
,
y
=
360
,
width
=
100
,
height
=
40
)
create_Btn
.
place
(
x
=
2
6
0
,
y
=
360
,
width
=
100
,
height
=
40
)
# texte à coder
# texte à coder
labelTexte
=
Label
(
saisie
,
text
=
'
Texte
à coder :'
,
bg
=
"lightgray"
)
labelTexte
=
Label
(
saisie
,
text
=
'
Données
à coder :'
,
bg
=
"lightgray"
)
labelTexte
.
place
(
x
=
10
,
y
=
10
)
labelTexte
.
place
(
x
=
10
,
y
=
10
)
texte
=
Entry
(
saisie
,
width
=
122
)
texte
=
Entry
(
saisie
,
width
=
122
)
texte
.
place
(
x
=
30
,
y
=
40
)
texte
.
place
(
x
=
30
,
y
=
40
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment