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
zepelin [54]
3 years ago
15

Write a program that will generate a personalized invitation within a text file for each guest in the guest list file using the

event information found in the event details file. Put all the generated invitation files in a directory called invitations. Ensure that the name of each invitation file uniquely identifies each guest's invitation
Computers and Technology
1 answer:
vlada-n [284]3 years ago
7 0

Answer:

Code:  

import os   # os module to create directory  

event_file = open("event_details.txt", "r") # Getting event file  

event_details = ""  # event details to be stored  

for row in event_file:  # traversing through the event_file  

   event_details += row    # appending event details  

os.mkdir("./invitations")   # make directory in the same parent directory  

names = open("guest_list.txt", "r") # getting names of the people  

for name in names:  # traversing through names in guest_list file

   name = name.replace('\n', '')   # removing the ending '\n' from the name  

   invitation_msg = "Hi! " + name + ", You are heartly invited in the Ceremony.\nAt " + event_details # Generating the invitation message  

   file_name = '_'.join(name.split(' '))   # Spliting name in space and joining with the '_'  

   file_path = "./invitations/" + file_name + ".txt" # Generating each file path  

   invite_file = open(file_path, "w")  # Creating the file for each name  

   invite_file.write(invitation_msg)   # Write invitation to file

Output:

You might be interested in
Olivia has developed a great presentation with a distinct purpose and excellent content. She delivered it in a workshop and got
Umnica [9.8K]

less time and depth is required for panel discussions

3 0
3 years ago
Match the graph with the best description of the relationship it shows.
igomit [66]

Answer:

there is no graph

Explanation:

3 0
3 years ago
In order for your laptop to make a wireless connection, it must first find an available __________ to connect to.
Nitella [24]
The answer is Service Set Identifier or SSID.

Every wireless router sends out a beacon signal to allow other devices such as laptops, wifi printers, personal cellphones when set to look for and connect to the routers SSID. This SSID can also be shut off or hidden from public domains so not every person stopping by can try to connect to the router via the SSID. Usually you must have a password to follow an attempt to connect to the exact wireless router.
3 0
3 years ago
Why do most people share, especially photos online using social media?
Nadusha1986 [10]
“3. To get attention from others (brag)”
8 0
3 years ago
Read 2 more answers
Game development is a time-consuming and expensive endeavor, and being a Lone Ranger is a recipe for disaster
belka [17]
False although depends on the future of the person's ideas
7 0
3 years ago
Other questions:
  • Why is it important to not get distracted while driving?
    13·2 answers
  • If it is impractical to place guest users in a secure network, isolated from the production network by firewall barriers, then:
    14·1 answer
  • There are no breakpoints in the "Access Customer Account" subpage however there is an error. What will happen if you choose to s
    11·1 answer
  • Adam is evaluating the security of a web server before it goes live. He believes that an issue in the code allows an SQL injecti
    5·1 answer
  • Harmful programs used to disrupt computer operation, gather sensitive information, or gain unauthorized access to computer syste
    10·1 answer
  • Rewritable (write, erase, write again) is known as _______.
    7·1 answer
  • Write a C++ Programm in which inheritance is used
    7·1 answer
  • Linda wants to change the color of the SmartArt that she has used in her spreadsheet. To do so, she clicks on the shape in the S
    5·1 answer
  • 2. Released in 1992, Street Fighter II, the revolutionary fighting game, was developed by which company?
    8·2 answers
  • What are the consequences of digital footprint ?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!