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
d1971a78
Commit
d1971a78
authored
Jan 02, 2024
by
Thorfin89
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Toutes les fonctions de gestion des fichiers sont opérationnelles. Mise à jour du README.
parent
ad47beb0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
17 deletions
+41
-17
README.md
README.md
+15
-2
objQRCode-01.png
images/objQRCode-01.png
+0
-0
objQRCode-02.png
images/objQRCode-02.png
+0
-0
main.py
main.py
+26
-15
No files found.
README.md
View file @
d1971a78
# objQRCode
![
objQRCode-02
](
README.assets/objQRCode-02.png
)
**objQRCode**
est un utilitaire pour créer des QRCode écrit en python.
C'est en fait une interface graphique pour
**qrcode**
(https://pypi.org/project/qrcode/) sous python.
L'application est en cours de développement.
Toute les fonctions sont opérationnelles :
-
ouverture d'un QRCode au format PNG
-
décodage de l'image
-
codage au format PNG d'un texte, une url
-
codage d'un accès WIFI
-
choix des couleurs (points et fond)
-
taille du QRCode
-
épaisseur de la bordure
-
enregistrement de l'image au format PNG
Il reste quelles petites améliorations
à faire, tant fonctionnelles qu'esthétiques,
voire quelques fonctions supplémentaires à ajouter.
## Paquets à installer :
...
...
@@ -37,4 +51,3 @@ WIFI:T:*cryptage(nopass, WEP, WAPA)*;S:ssid;P:*motdepasse*;H:*caché(true)*
### qrcode - python
-
https://pypi.org/project/qrcode/
images/objQRCode-01.png
0 → 100644
View file @
d1971a78
65.7 KB
images/objQRCode-02.png
0 → 100644
View file @
d1971a78
44.9 KB
main.py
View file @
d1971a78
...
...
@@ -16,14 +16,14 @@ from PIL import Image
fg_color
=
"#000000"
bg_color
=
"#FFFFFF"
version
=
3
cur
ent_file
=
"
"
cur
rent_file
=
"temp.png
"
# ===== FONCTIONS =====
def
new_file
():
global
curent_file
cur
ent_file
=
"
"
global
cur
r
ent_file
cur
rent_file
=
"temp.png
"
# on vide toutes les zones de saisie
ssid_name
.
delete
(
0
,
'end'
)
password
.
delete
(
0
,
'end'
)
...
...
@@ -33,11 +33,13 @@ def new_file():
# ouverture d'un fichier
def
open_file
():
global
curent_file
file
=
filedialog
.
askopenfilename
(
title
=
"Ouvrir un QRCode au format PNG"
,
defaultextension
=
"png"
,
global
current_file
file
=
filedialog
.
askopenfilename
(
title
=
"Ouvrir un QRCode au format PNG"
,
defaultextension
=
"png"
,
initialdir
=
"./qrcodes"
)
curent_file
=
file
cur
r
ent_file
=
file
# on vide les zones de saisie du WIFI
ssid_name
.
delete
(
0
,
'end'
)
password
.
delete
(
0
,
'end'
)
text
.
delete
(
0
,
'end'
)
...
...
@@ -49,15 +51,14 @@ def open_file():
# enregistrer un fichier sous
def
save_as
():
global
curent_file
if
curent_file
!=
""
:
global
cur
r
ent_file
if
cur
r
ent_file
!=
""
:
file
=
filedialog
.
asksaveasfilename
(
title
=
"Enregistrer le QRCode au format PNG sous"
,
filetypes
=
[(
"Fichier PNG"
,
"png"
)],
defaultextension
=
"png"
,
initialdir
=
"./qrcodes"
)
curent_file
=
file
print
(
curent_file
)
current_file
=
file
code
()
else
:
messagebox
.
showerror
(
"Erreur"
,
"Le fichier est vide"
)
...
...
@@ -148,6 +149,7 @@ def verif_before_code():
def
code
():
global
current_file
global
qrcode_img
bs
=
boxe_size_scale
.
get
()
...
...
@@ -164,17 +166,19 @@ def code():
# création et sauvegarde de l'image du QRCode
img
=
qr
.
make_image
(
fill_color
=
fg_color
,
back_color
=
bg_color
)
img
.
save
(
'qrcode.png'
)
img
.
save
(
current_file
)
def
display_qrcode
():
global
qrcode_img
global
current_file
# calcul de la taille du QRCode pour le centrer dans la fenêtre
img
=
Image
.
open
(
"qrcode.png"
)
img
=
Image
.
open
(
current_file
)
size
=
img
.
size
# affichage du QRCode
qrcode_img
=
PhotoImage
(
file
=
"qrcode.png"
)
qrcode_img
=
PhotoImage
(
file
=
current_file
)
qrcode_label
.
config
(
image
=
qrcode_img
,
bg
=
"white"
)
qrcode_label
.
place
(
x
=
198
-
size
[
0
]
//
2
,
y
=
198
-
size
[
1
]
//
2
)
# centrage
...
...
@@ -201,16 +205,18 @@ menu_general = Menu(root)
# Création du menu principal 'Fichier'
menu_fichier
=
Menu
(
menu_general
,
tearoff
=
0
)
menu_general
.
add_cascade
(
label
=
"Fichier"
,
menu
=
menu_fichier
)
# Création des sous menus 'Fichiers'
menu_fichier
.
add_command
(
label
=
"Nouveau"
,
command
=
new_file
)
menu_fichier
.
add_command
(
label
=
"Ouvrir"
,
command
=
open_file
)
menu_fichier
.
add_command
(
label
=
"Enregistrer"
)
menu_fichier
.
add_command
(
label
=
"Enregistrer"
,
command
=
code
)
menu_fichier
.
add_command
(
label
=
"Enregistrer sous"
,
command
=
save_as
)
menu_fichier
.
add_command
(
label
=
"Quitter"
,
command
=
quit
)
# Création du menu principal 'Aide'
menu_aide
=
Menu
(
menu_general
,
tearoff
=
0
)
menu_general
.
add_cascade
(
label
=
"Aide"
,
menu
=
menu_aide
)
# Création des sous menus 'Aide'
menu_aide
.
add_command
(
label
=
"Info"
,
command
=
info
)
...
...
@@ -254,16 +260,19 @@ border_size_scale.place(x=180, y=90)
# ===== point d'accès WIFI =====
wifi_title
=
Label
(
left_frame
,
text
=
'CONFIGURATION DU WIFI :'
,
bg
=
"#CCCCCC"
)
wifi_title
.
place
(
x
=
30
,
y
=
175
)
# SSID
ssid_name_title
=
Label
(
left_frame
,
text
=
'SSID :'
,
bg
=
"#CCCCCC"
)
ssid_name_title
.
place
(
x
=
30
,
y
=
200
)
ssid_name
=
Entry
(
left_frame
,
width
=
40
)
ssid_name
.
place
(
x
=
30
,
y
=
225
)
# Password
password_title
=
Label
(
left_frame
,
text
=
'Mot de passe :'
,
bg
=
"#CCCCCC"
)
password_title
.
place
(
x
=
30
,
y
=
250
)
password
=
Entry
(
left_frame
,
width
=
40
)
password
.
place
(
x
=
30
,
y
=
275
)
# Cryptage
crypt_title
=
Label
(
left_frame
,
text
=
'Cryptage :'
,
bg
=
"#CCCCCC"
)
crypt_title
.
place
(
x
=
300
,
y
=
200
)
...
...
@@ -271,12 +280,14 @@ crypt_list = ["WPA", "WEP", "Aucun"]
crypt_choice
=
SmartSpinBox
(
root
,
entry_type
=
'str'
,
width
=
8
,
justify
=
CENTER
,
values
=
crypt_list
,
callback
=
no_password
)
crypt_choice
.
place
(
x
=
300
,
y
=
225
)
# Caché
hide_title
=
Label
(
left_frame
,
text
=
'Caché :'
,
bg
=
"#CCCCCC"
)
hide_title
.
place
(
x
=
300
,
y
=
250
)
hide_list
=
[
"NON"
,
"OUI"
]
hide_choice
=
Spinbox
(
left_frame
,
values
=
hide_list
,
width
=
8
,
justify
=
CENTER
)
hide_choice
.
place
(
x
=
300
,
y
=
275
)
# Transfert du code dans les données à coder
transfert_btn
=
Button
(
left_frame
,
text
=
"Transfert
\n
vers
\n
données"
,
bg
=
"#61AEF9"
,
command
=
transfert
)
...
...
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