Найти - Пользователи
Полная версия: Python запускает выбора директории сразу после старта программы Помогите пожалуйста
Начало » Центр помощи » Python запускает выбора директории сразу после старта программы Помогите пожалуйста
1
tempkoder12
 #import's ####################
import os
from os import *
import tkinter
from tkinter import *
from tkinter import filedialog
from pygame import mixer
##############################
MGI = tkinter.Tk()
MGI.title("LISTE BY ME 0.0.2")
MGI.geometry('640x500')
pryoimge1 = PhotoImage(file = "C:/Users/Koder1554/Desktop/porgras/folder.png")
pryoimge2 = PhotoImage(file = "C:/Users/Koder1554/Desktop/porgras/mp_btns_play.png")
PathSelect_button_icon = pryoimge1.subsample(8,8)
PlayTreak_button_icon = pryoimge2.subsample(10,10)
#func
def Select_folder():
	dirctory = filedialog.askdirectory()
#interface
PathSelect_button = Button(MGI,  image = PathSelect_button_icon ,command = Select_folder())
PlayTreak_button = Button(MGI, image = PlayTreak_button_icon)#command = Play_Treak()
mp3_listbox = Listbox(MGI, width  = 200 , height = 55)
#placing widgts
PathSelect_button.place(x = 10, y = 1)
mp3_listbox.place(x =  20, y = 110)
PlayTreak_button.place(x = 10, y= 58 )
#run tkinter
MGI.mainloop()


От компилятора ошибок нет
JOHN_16
tempkoder12
от компилятора ошибок нет потмоу что Питон интерпретируемый ЯП. Неожиднно, да?
tempkoder12
Button(MGI, image = PathSelect_button_icon ,command = Select_folder())
Select_folder должен быть без скобочек. Потмоу что вы передаете туда объект функции,а не результат ее выполнения.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB