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]
2 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]2 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
Describe the components of the Web. Your friend wants to create and publish a Web page. He tells you that he wants to learn the
iren [92.7K]

Answer:

The answer is "HTML".

Explanation:

We will suggest him to learn HTML language because It stands for HyperText Markup Language. It is a markup language that uses a build a web page and these sites are normally viewed on the web browser.

  • It is the language for development used in the World Wide Web.
  • This language includes writing, links, images, videos, and audio files.  
  • Each one of these kinds of content is tagged and described by HTML, which uses a web browser can display it correctly.
3 0
2 years ago
Microsoft Publisher - Assignment #1
Allisa [31]

Answer:1

Explanation:

6 0
3 years ago
O How basic blocks are identified and how the blocks are used to construct control flow graphs
OLEGan [10]

Basic blocks are identified  because they are known to be a straight line that is known also as a code sequence that tends to have no branches in regards to its in and out branches and its exception is only to the entry and at the end.

Note that  Basic Block is said to be a composition  of statements that is known to be one that often always executes one after other, and this is often done in a sequence.

<h3>How do you create a flow graph from the basic blocks?</h3>

Flow graph  is gotten by:

  • Lets Block B1 be the initial node and also Block B2 will tend to follows B1, so from B2 to B1 there is seen a kind of an edge.

Note that the first task is for a person to partition a sequence of three-address code and this is done into basic blocks.

Hence, Basic blocks are identified  because they are known to be a straight line that is known also as a code sequence that tends to have no branches in regards to its in and out branches and its exception is only to the entry and at the end.

Learn more about basic blocks from

brainly.com/question/132319

#SPJ1

5 0
1 year ago
2. The part of the computer that provides access to the Internet is the A. monitor. B. keyboard. C. system unit. D. modem.
allochka39001 [22]
The modem provides access to the internet.
4 0
3 years ago
Read 2 more answers
Write a python program to print the following series 3..10..31..94......n​<br><br>Pls answer fast..
butalik [34]

I've included my code in the picture below. Best of luck

8 0
2 years ago
Other questions:
  • To reduce chances of system failure, engineers may use _____ .
    10·2 answers
  • Briefly define "address space" and discuss its major tradeoffs (advantages/costs). What problem is it addressing?
    10·1 answer
  • The ________ is responsible for the Internet's domain name system and the allocation of IP addresses.
    12·1 answer
  • An ____ is a collection of tools, features, and interfaces that enables users to add, update, manage, access, and analyze the co
    10·1 answer
  • What is the final value for X ?<br><br> x= 1<br><br> x=13<br><br> x= x+3<br><br> x=0
    9·1 answer
  • identify at least three additional ethical responsibilities expected from a computer professional. In brief, explain each respon
    11·1 answer
  • What is the name of the FOLDER in which the file named "script" is contained?
    13·1 answer
  • ____________________________ and _________________________ are 2 negative impacts of the internet on businesses.
    8·1 answer
  • There is a file of a few Sean Connery movies on the internet. Each entry has the following form:
    9·1 answer
  • Which group scope can be used to assign permissions to resources only in the domain in which the group is created
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!