Automatically Generate a PDF and send it by Email

Introduction

You work for a company that sells second hand cars. Management wants to get a summary of the amounts of vehicles that have been sold at the end of every month. The company already has a web service which serves sales data at the end of every month but management wants an email to be sent out with an attached PDF so that data is more easily readable.

What you'll do

  • Write a script that summarizes and processes sales data into different categories
  • Generate a PDF using Python
  • Automatically send a PDF by email
#!/usr/bin/env python3

import emails
import os
import reports

table_data=[
  ['Name', 'Amount', 'Value'],
  ['elderberries', 10, 0.45],
  ['figs', 5, 3],
  ['apples', 4, 2.75],
  ['durians', 1, 25],
  ['bananas', 5, 1.99],
  ['cherries', 23, 5.80],
  ['grapes', 13, 2.48],
  [&#
上一篇:java复制一个文件到另一个目录下


下一篇:Android访问设置