Cara menggunakan python image viewer

Have you ever wondered to make a Image viewer with the help of Python? Here is a solution to making the Image viewer with the help of Python. We can do this with the help of Tkinter and pillow. We will discuss the module needed and code below. 

Show

Module Needed

  • Tkinter: Tkinter is library with the help of which we can make GUI(Graphical  User Interface).
 pip install tkinter
  • Pillow: We can add photos as it is an imaging library of Python.
 pip install pillow

Now let’s code for it

Getting Started

  • Below Code demonstrates the basic structures, button initialization, and layout of the GUI produced

Python3




# importing the tkinter module and PIL that

# is pillow module

from tkinterimport *

from PILimport

 pip install pillow
1

 

 pip install pillow
2

 pip install pillow
3
 pip install pillow
4
 pip install pillow
5

 

 pip install pillow
6

 pip install pillow
7
 pip install pillow
8
 pip install pillow
9

 

# importing the tkinter module and PIL that0

# importing the tkinter module and PIL that1

# importing the tkinter module and PIL that2# importing the tkinter module and PIL that3

 pip install pillow
9

 

# importing the tkinter module and PIL that5

# importing the tkinter module and PIL that6

# importing the tkinter module and PIL that7

# importing the tkinter module and PIL that8

# importing the tkinter module and PIL that9

 pip install pillow
4 # is pillow module1# is pillow module2# is pillow module3# is pillow module4# is pillow module5

# is pillow module6

 pip install pillow
4 # is pillow module1# is pillow module2# is pillow module3from1# is pillow module5

from3

 pip install pillow
4 # is pillow module1# is pillow module2# is pillow module3# is pillow module4# is pillow module5

tkinter0

 pip install pillow
4 # is pillow module1# is pillow module2# is pillow module3from1# is pillow module5

 

tkinter7

tkinter8

 pip install pillow
4 import0

 

import1

 pip install pillow
4 import3
 pip install pillow
4import5

 

import6

import7

 pip install pillow
4import9*0
 pip install pillow
4*2*3
 pip install pillow
4*5
 pip install pillow
9

 

*7

*8

 pip install pillow
4 from0
 pip install pillow
4from2from3
 pip install pillow
4from5

from6from7

 pip install pillow
4from9

 

PIL0

PIL1

 pip install pillow
4 from0
 pip install pillow
4PIL5PIL6

from6PIL8

 pip install pillow
4
 pip install pillow
00

 

 pip install pillow
01
 pip install pillow
4 from0
 pip install pillow
4
 pip install pillow
05PIL6

 pip install pillow
07PIL8
 pip install pillow
4
 pip install pillow
10
 pip install pillow
11import9# is pillow module5

 

 pip install pillow
14

 pip install pillow
15
 pip install pillow
4
 pip install pillow
17*0
 pip install pillow
4*2
 pip install pillow
9

 pip install pillow
22
 pip install pillow
4
 pip install pillow
17*0
 pip install pillow
4import9
 pip install pillow
9

 pip install pillow
29
 pip install pillow
4
 pip install pillow
17*0
 pip install pillow
4
 pip install pillow
34
 pip install pillow
9

 

 pip install pillow
36

  • Forward function: This function is for adding the functionality to forward button

Python3




 pip install pillow
37
 pip install pillow
38

 

 pip install pillow
39
 pip install pillow
40

 pip install pillow
39
 pip install pillow
42

 pip install pillow
39
 pip install pillow
44

 pip install pillow
39
 pip install pillow
46 import1

 pip install pillow
39
 pip install pillow
46
 pip install pillow
01

 pip install pillow
39
 pip install pillow
46 *8

 pip install pillow
39
 pip install pillow
46 PIL1

 pip install pillow
39
 pip install pillow
58

 

 pip install pillow
39
 pip install pillow
60

 pip install pillow
39
 pip install pillow
62

 pip install pillow
39import1
 pip install pillow
4 import3
 pip install pillow
4
 pip install pillow
68
 pip install pillow
69import9
 pip install pillow
71

 

 pip install pillow
39
 pip install pillow
73

 pip install pillow
39
 pip install pillow
75

 pip install pillow
39import7
 pip install pillow
4import9*0
 pip install pillow
4*2*3
 pip install pillow
4*5
 pip install pillow
9