1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
emmainna [20.7K]
3 years ago
10

Write a GUI-based program that allows the user to open, edit, and save text files. The GUI should include a labeled entry field

for the filename and multi-line text widget for the text of the file. The user should be able to scroll through the text by manipulating a vertical scrollbar. Include command buttons labeled Open, Save, and New that allow the user to open, save and create new files. The New command should then clear the text widget and the entry widget.
Computers and Technology
1 answer:
Korvikt [17]3 years ago
6 0

to create a simple notepad in Python using Tkinter. This notepad GUI will consist of various menu like file and edit, using which all functionalities like saving the file, opening a file, editing, cut and paste can be done.

Now for creating this notepad, Python 3 and Tkinter should already be installed in your system. You can download suitable python package as per system requirement. After you have successfully installed python you need to install Tkinter (a Python’s GUI package).

Use this command to install Tkinter :

pip install python-tk

Importing Tkinter :

filter_none

edit

play_arrow

brightness_4

import tkinter  

import os  

from tkinter import *

 

# To get the space above for message  

from tkinter.messagebox import *

 

# To get the dialog box to open when required  

from tkinter.filedialog import *

Note : messagebox is used to write the message in the white box called notepad and filedialog is used for the dialog box to appear when you are opening file from anywhere in your system or saving your file in a particular position or place.

 

Adding Menu :

filter_none

edit

play_arrow

brightness_4

# Add controls(widget)  

 

self.__thisTextArea.grid(sticky = N + E + S + W)  

 

# To open new file  

self.__thisFileMenu.add_command(label = "New",  

                               command = self.__newFile)  

 

# To open a already existing file  

self.__thisFileMenu.add_command(label = "Open",  

                               command = self.__openFile)  

 

# To save current file  

self.__thisFileMenu.add_command(label = "Save",  

                               command = self.__saveFile)  

 

# To create a line in the dialog  

self.__thisFileMenu.add_separator()  

 

# To terminate  

self.__thisFileMenu.add_command(label = "Exit",  

                               command = self.__quitApplication)  

self.__thisMenuBar.add_cascade(label = "File",  

                              menu = self.__thisFileMenu)  

 

# To give a feature of cut  

self.__thisEditMenu.add_command(label = "Cut",  

                               command = self.__cut)  

 

# To give a feature of copy  

self.__thisEditMenu.add_command(label = "Copy",  

                               command = self.__copy)  

 

# To give a feature of paste  

self.__thisEditMenu.add_command(label = "Paste",  

                               command = self.__paste)  

 

# To give a feature of editing  

self.__thisMenuBar.add_cascade(label = "Edit",  

                              menu = self.__thisEditMenu)  

 

# To create a feature of description of the notepad  

self.__thisHelpMenu.add_command(label = "About Notepad",  

                               command = self.__showAbout)  

self.__thisMenuBar.add_cascade(label = "Help",  

                              menu = self.__thisHelpMenu)  

 

self.__root.config(menu = self.__thisMenuBar)  

 

self.__thisScrollBar.pack(side = RIGHT, fill = Y)  

 

# Scrollbar will adjust automatically  

# according to the content  

self.__thisScrollBar.config(command = self.__thisTextArea.yview)  

self.__thisTextArea.config(yscrollcommand = self.__thisScrollBar.set)  

With this code we will add the menu in the windows of our notepad and will add the things like copy, paste, save etc, to it.

Explanation:

You might be interested in
Name the different payment systems the shophive.com isusing?
olganol [36]

Answer:

 Different payment systems the shophive.com is using are that everyone has the different feasibility and some users are comfortable with credit cards, debit cards while some users are comfortable with cash on delivery. Shophive brings the best opportunity for customers to experience the best online shopping in Pakistan. Unlike other online shopping website in Pakistan, shophive do not pressurize our customers.  As they provide customers with the freedom of choice and the flexibility so, that they live up their dreams.

4 0
3 years ago
Choose the correct statement:_______.
olga2289 [7]

Answer:

d. A String is a class data type so a String variable holds a reference to a location in memory

It depends on which programing language or scripting language...

Explanation:

If it's Java then D is the correct answer...

6 0
3 years ago
What are the atoms in grp one? periodic table. I am going to mark as brainliest ​
Maru [420]

Answer:

Atoms in group 1:

H

Li

Na

K

Rb

Cs

Fr

3 0
3 years ago
Video-sharing sites such as youtube and vimeo provide a place to post short videos called clips, true or false?
yaroslaw [1]
<span>It is true that video-sharing sites such as Youtube and Vimeo provide a place to post short videos called clips. Nowadays, these videos aren't only short, because even full-length movies can be posted on Youtube. This platform has become an important place for contemporary creators given that it provides them with a location and money to share their creative thoughts with the world. Youtube is becoming more and more important today, which is obvious if you take a look at the number of visitors each month and the money that Youtube earns from its creators.</span>
4 0
4 years ago
Important tools used in the _____ phase of the DMAIC process include a project charter, a description of customer requirements,
Anna71 [15]
Important tools used in the "Define" phase of the DMAIC process include a project charter, a description of customer requirements, process maps, and Voice of the Customer (VOC) data.
6 0
3 years ago
Other questions:
  • A company wishes to move all of its services and applications to a cloud provider but wants to maintain full control of the depl
    7·1 answer
  • Which group on the Home Ribbon allows you to add shapes to a PowerPoint slide?
    10·2 answers
  • After typing “application letter” in the Search window in the New dialog box, Nate clicks the Education category. Three letters
    9·1 answer
  • Differences between iphone 6 and 6s
    6·1 answer
  • What would be advantageous for a laptop user to carry when the laptop gets a lot of use?
    14·1 answer
  • What are the functions of online gaming communities?
    12·1 answer
  • Diane is receiving a lot of unwanted e-mail. What steps can she take to reduce the amount of e-mail she receives?
    12·1 answer
  • Given a String variable named line1, write a sequence of statements that use a Scanner to read the first line of a file named "p
    7·1 answer
  • A palindrome is any word, phrase, or sentence that reads the same forward and backward. Here are some well-known palindromes: Ab
    11·1 answer
  • HELP PLEASE!!!! If you are continually building, reviewing, correcting a model of your system, and incrementally adding to the s
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!