Coder Social home page Coder Social logo

draftingletters's Introduction

Drafting Emails Project

This project is designed to help students learn about file systems and relative file paths in Python. The task involves reading data from text files, manipulating strings, and writing the output to new text files. Project Structure

The project has the following directory structure:

.
├── Contacts
│   └── names.txt
├── Email
│   └── draft.txt
└── Send
  • Contacts: This directory contains a file called names.txt which lists the names of the contacts to whom emails need to be sent.
  • Email: This directory contains a file called draft.txt which serves as a template for the emails to be sent.
  • Send: This directory will contain the final output of the project, i.e., the individual email drafts for each contact.

Instructions

  1. Read the names from the names.txt file located in the Contacts directory. Each line in the file contains a single name.

  2. For each name, create an individual email using the draft.txt file located in the Email directory. The draft.txt file contains the text of the email with a placeholder, [name], which should be replaced with the actual name.

  3. Save each personalized email in the Send directory. The file should be named Letter_for_<name>.txt, where <name> is the name of the contact.

Tips

Remember that Python strings are immutable, which means you need to assign the result of the replace() function to a new variable. Be mindful of the case when replacing text. The replace() function is case-sensitive. Make sure to use relative file paths when opening files. This makes your program more portable and easier to run on different machines.

draftingletters's People

Contributors

zzerone21 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.