Bonjour,
Je suis débutant en python, je suis sur la version 2.7.3
j'utilise Tkinter.
j'ai fait une fonction
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 def test_resolution(): #system('xrandr -q | grep "Screen 0" | cut -c38-47') #Kubuntu 14.04 LTS x64 system('xrandr -q | grep "Screen 0" | cut -c34-44') #Kubuntu 12.04 LTS x64
Mais je n'arrive pas a passer ma fonction en variable
ça marche pas.
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 r = (test_resolution() print "r : ", r if r=="1920 x 1080": print "Resolution = 1920 x 1080" i = 4 n = 4 if r=="3286 x 1080": print "Resolution = 3286 x 1080" i = 3 n = 3 if r=="5264 x 1050": print "Resolution = 5264 x 1050" i =2 n = 2
Comment dois-je faire ?
Merci.
Partager