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
HEYY GUYS START REPORTING ALL THE SPAMMERS PLSS!!!!! For the spammers, I hope you go to hell >:c!!!!!!!!!!!
Molodets [167]

Answer:

i totally agree

Explanation:

4 0
3 years ago
When inserting a fly in animation what is the first step in the process?
weqwewe [10]

Answer:

you select the element you wish to animate

6 0
3 years ago
When you connect to an Access database, which entities are shown in the Navigator window?
Leni [432]

1DFASDFAASDASDFASDFADSFASFD

4 0
2 years ago
Read 2 more answers
Which of the following allows data to coordinate activity between devices? Select one: a. Address bus b. Collisions c. Data bus
AnnyKZ [126]

Answer:

The correct option is D: Control Bus

Explanation:

A control bus is usually used by the Central Processing Unit to communicate with all the devices that are connected or contained within a computer. This connections are usually done via physical connections such as printed circuits or cables. It is also called a Computer bus and helps in coordinating activities between the connected devices.

5 0
3 years ago
A 30V battery maintains a current through a 10 Ω Resistor. What is the current flow through the resistor?
Troyanec [42]

Answer:

3 amps

Explanation:

because as per ohm's law. "electric current is proportional to voltage and inversely proportional to resistance"

7 0
3 years ago
Other questions:
  • Într-o curte sunt G găini și O oi. Să se determine numărul de capete și numărul de picioare din curte.
    13·1 answer
  • Which CSS attribute would change an element's font color to blue? font-color: blue; background: blue; color: blue; background-co
    10·2 answers
  • Match the keyboard shortcuts to the function they perform
    10·1 answer
  • This exercise shows why each pivot (in eli1nination by pivoting) must be in a different row. (a) In Example 7, make the third pi
    15·1 answer
  • 50 points! ㅠㅠ does anyone speak korean or watch korean animes? 안녕 ㅋㅋ ㅇㅅㅇ How do people make animationsss.
    8·2 answers
  • 1. Write a 400-500 word research report about Burke High School.
    6·1 answer
  • Why can’t I see one individual’s questions in the app through their profile, but I can see their questions on the website?
    12·2 answers
  • Why does a crane need to rotate/swivel​
    9·1 answer
  • How do i know my child's login info for parent infinite campus
    14·1 answer
  • Think of some local businesses that have websites. Look online and identify two different websites for businesses or services in
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!