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
You want to drive traffic to a new landing page for a campaign, and want a web address that's short, easy to remember, trackable
Akimi4 [234]

Hootsuite supports you with vanity URLs.

1. vanity URLs

<u>Explanation:</u>

Since the website webpage is landing on campaign, heavy network traffic is expected. Better to have multiple URL methods but it will not solve the purpose of heavy of network access of webpage or web site. Better to use vanity URLS methods to use heavy network traffic.

Vanity URLS means is customizable redirecting or rerouting by branding links or customized URL link. These type of vanity URLS by choosing hosting service and customize link been created. So end user can use link.

6 0
3 years ago
What can be used to help diagnose and fix computer hardware problems?
Klio2033 [76]

the answer is D which is system utilities

hope this helps and hope it isn't wrong

8 0
2 years ago
The part of the computer that provides access to the internet is the
Kruka [31]
Modem, is the part of the computer that provides access to the internet.
3 0
3 years ago
How often should you typically monitor your checking account?
alex41 [277]
It usually<span> takes three months for </span>your<span> budget to begin working well. ... When </span>you<span> use credit cards, the money is </span>much<span> easier to keep </span>track<span> of, </span>
5 0
3 years ago
Which term describes the process of training a machine to do simple, repetitive tasks, and adapt or correct its performance base
iogann1982 [59]
Automation. It involves taking a machine or software that was taught to do simple repetitive tasks (traditional automation) and teaching it to intuitively adapt or correct its performance based on changing conditions, at speed and scale.
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is correct implementation code for the compareTo method in the ExpertPlayer class?
    12·1 answer
  • Complete the sentence.
    6·2 answers
  • What is the maximum number of communication paths for a team of twenty people?
    5·1 answer
  • Assume that the vector arr has been declared. In addition, assume that VECTOR_SIZE has been defined to be an integer that equals
    10·1 answer
  • The premise of this exam is to synthesize your knowledge and understanding of recursion. Your synthesize may be in the form of a
    14·1 answer
  • Which tool should be used when a fastener, such as a lug nut, is extremely tight
    6·2 answers
  • Given the following class definition and the variable declaration:
    11·1 answer
  • . It has been said that technology will be the end of management. Maybe. How about artificial intelligence
    9·1 answer
  • Lesson 3 - Calling All Operators
    6·1 answer
  • Write a static method named isSorted that takes an array of real numbers as a parameter and that returns true if the list is in
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!