change title, add test dir
This commit is contained in:
1 parent
d7fcaa70bb
commit
6bf6ae8c97
4 files changed
+20
-3
No files matched your search
+14
@@ -0,0 +1,14 @@
|
|||||||
|
.DS_Store
|
||||||
|
.idea
|
||||||
|
*.log
|
||||||
|
tmp/
|
||||||
|
|
||||||
|
*.tern-port
|
||||||
|
node_modules/
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
*.tsbuildinfo
|
||||||
|
.npm
|
||||||
|
.eslintcache
|
||||||
|
venv/
|
||||||
Regular → Executable
+6
-3
@@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
from tkinter import ttk
|
from tkinter import ttk
|
||||||
from PIL import Image, ImageTk
|
from PIL import Image, ImageTk
|
||||||
@@ -5,13 +7,14 @@ import os
|
|||||||
from os import listdir
|
from os import listdir
|
||||||
|
|
||||||
parent = tk.Tk()
|
parent = tk.Tk()
|
||||||
parent.title("Image in Tkinter")
|
parent.title("Perlinator")
|
||||||
|
parent.minsize(320, 240)
|
||||||
|
|
||||||
|
|
||||||
def button_clicked():
|
def button_clicked():
|
||||||
global isittrue
|
global isittrue
|
||||||
if isittrue == 0:
|
if isittrue == 0:
|
||||||
image2 = Image.open("test/ssh.png")
|
image2 = Image.open("test/tux.jpg")
|
||||||
image2 = ImageTk.PhotoImage(image2)
|
image2 = ImageTk.PhotoImage(image2)
|
||||||
image_label.configure(image=image2)
|
image_label.configure(image=image2)
|
||||||
image_label.image = image2
|
image_label.image = image2
|
||||||
@@ -57,7 +60,7 @@ for images in os.listdir(folder_dir):
|
|||||||
if images.endswith(".png") or images.endswith(".jpg") or images.endswith(".jpeg"):
|
if images.endswith(".png") or images.endswith(".jpg") or images.endswith(".jpeg"):
|
||||||
print(images)
|
print(images)
|
||||||
|
|
||||||
img = Image.open("test/couv.png")
|
img = Image.open("test/logo.png")
|
||||||
img = ImageTk.PhotoImage(img)
|
img = ImageTk.PhotoImage(img)
|
||||||
|
|
||||||
image_label = tk.Label(parent, image=img)
|
image_label = tk.Label(parent, image=img)
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Reference in new issue
Block a user