Bonjour,
Je suis débutant python 2.7.6.
J'ai fait des cases pour la détection de résolution de l'écran.
Seulement je ne comprends pas pourquoi quand il ne reconnait pas la résolution, il ne m'affiche pas la case else Résolution inconnu.
Comment faire ?
Merci.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
35
36
37
38
39
40
41
42
43
44
45 import Tkinter as tkinter fenetre = tkinter.Tk() width = fenetre.winfo_screenwidth() height = fenetre.winfo_screenheight() r = width , height if r==(800, 600): print "Resolution = 800 x 600" print "PC " print "essai n° 1" i = 0 n = 0 if r==(1920, 1080): print "Resolution = 1920 x 1080" print "PC " print "essai n° 1" i = 2 n = 2 if r==(800, 600): print "Resolution = 1920 x 1080" print "PC portable MSI de nathalie" print "essai n° 1" i = 2 n = 2 if r==(3286, 1080): print "Resolution = 3286 x 1080" print "PC portable medion natalie." print "essai n° 3" i = 4 n = 4 if r==(5264, 1050): print "Resolution = 5264 x 1050" print "PC fixe bureau asus laurent." print "essai n° 4" i = 3 n = 3 if r==5: print "Quitter" quit() else: print("\nRésolution inconnu") print width,"x", height print("Veuillez utiliser une résolution d'écran de 800x600, 1920x1080, 3286x1080, 5264x1050")
Partager