Kiran Kumar Panigrahi

Kiran Kumar Panigrahi

About


312 Articles Published

Articles by Kiran Kumar Panigrahi

Page 32 of 32

How to save the contents of a Textbox in Tkinter?

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 26-Oct-2021 8K+ Views

To save the contents of a Textbox in Tkinter, we can take the following steps −Create an instance of tkinter frame.Set the size of the frame using win.geometry method.Define a user-defined method "open_text" to open a text file in "read" mode. Read the contents of the text file and save it in a variable called "content". Then, use the "insert" method to insert the contentin a Textbox.Next, define another user-defined method called "save_text" and in it, use the "write" method to save the contents of the textbox in the text file.Create a text widget using the Text method with specified ...

Read More

How to make a new folder using askdirectory dialog in Tkinter?

Kiran Kumar Panigrahi
Kiran Kumar Panigrahi
Updated on 26-Oct-2021 3K+ Views

To make a new folder using askdirectory dialog in Tkinter, we can take the following steps −Import the required modules. filedialog module is required for askdirectory method. os module is required for makedirs method.Create an instance of tkinter frame.Set the size of the frame using win.geometry method.Define a user-defined method "create_subfolder". Inside the method, call filedialog.askdirectory to select a folder and save the path in a variable, source_path.We can use askdirectory method of filedialog to open a directory. Save the path of the selected directory in a 'path' variable.Then, use os.path.join and makedirs to create a sub-folder inside the parent ...

Read More
Showing 311–312 of 312 articles
« Prev 1 28 29 30 31 32 Next »
Advertisements