Webdef proceso (): ent = filedialog.askdirectory () # directorio entrada ini = int (inicio.get ()) pas = int (paso.get ()) fin = int (final.get ()) guar = nombre.get () sali = filedialog.askdirectory () #directorio salida rango = range (ini,fin + pas,pas) arc = open (str (sali)+"/"+str (guar),"w") for i in rango: data = open (str (ent)+"/defo."+str … WebGo with this code First, select the directory for creating a new file import tkinter as tk from tkinter import filedialog root = tk.Tk () root.withdraw () # file_path = filedialog.askopenfilename () file_path = filedialog.askdirectory () new_file = input ("Name file\n") open_file = open (f" {file_path}\%s.py" % new_file, 'w') in my case
Get a file
WebJun 15, 2015 · In Python, using Tkinter, I'm trying to use tkFileDialog.askdirectory to get the users selection of a directory. It works - in so much as the dialog screen shows up OK, and there is a list of directory names to choose from. I can then double click on a directory name and go down several levels. Webask: 1 v make a request or demand for something to somebody “She asked him for a loan” Types: show 6 types... hide 6 types... request ask (a person) to do something solicit … boliches managua
python - askdirectory() closing Tkinter window - Stack Overflow
WebJan 16, 2024 · In a part of my code, I am going to get the directory of files from user. To do this there is an Open Button and Entry bar which shows the address like the picture below: Open Button is bound to filedialog.askdirectory () and user could navigate through directories. The class below do this task: WebSep 24, 2015 · To call a function to ask for a directory, you need to create a function, and tie that function to a button. What you were doing was actually calling the function before you create the other widgets, rather than wait for the button press. WebMay 3, 2024 · When I try to use some TKinter functions (like filedialog.askdirectory) Spyder´s console freeze. I´ve been reading different forums but still no one has the same problem or a solution to this problem. Here is a simple code that would work in … boliches mdp