Question: Hi, what is the python solution to this? Write a program that sends a random inspirational quote to an email address. The email address should

 Hi, what is the python solution to this? Write a programthat sends a random inspirational quote to an email address. The email

Hi, what is the python solution to this?

Write a program that sends a random inspirational quote to an email address. The email address should be a command-line parameter passed to the program. You should have a list of quotes in a file by itself. Your program should grab one and send the email. Your final email quotes should be formatted like this: "The only true measure of success if the number of people you have helped" Ray Dalio Node After npm init you should add your own script to package.json. Look for scripts inside the file. you should be able to do the following: npm run send_inspiration ... The command needs to allow you to pass in an email address from the command line. Take a look at this Also note that good code is written to be reusable. Make sure all your executable code is inside useful functions. When we run npm run send_inspiration then the right functions will need to be executed. Python You should be able to run your code using python send_inspiration.py ... The command needs to allow you to pass in an email address from the command line. Take a look at this Go with the simplest option you can find initially - because KISS Also note that good code is written to be reusable. Make sure all your executable code is inside useful functions. When we run npm run send_inspiration then the Also note that good code is written to be reusable. Make sure all your executable code is inside useful functions. When we run npm run send_inspiration then the right functions will need to be executed. Testing your project Your unit tests should make sure that when the application runs then it sends one email with one quote to one person. If your tests send actual emails require your smtp secret values then they are wrong. Please make sure that you understand what mocks and spies are for when writing your tests. These things do not exist to take up space, waste time or look fancy. They do have a purpose. If you do anything that looks like the following pseudocode then you are doing it wrong: spyon (myFunction) myFunction() assert myFunction wasCalleonce Here is a useful way to think about mocks and spies: Basically, sending emails is considered "expensive". Why? Because it costs actual money if you do it in bulk. Also it costs time. It is not a fast and free operation. But it is an important operation. You need to test that when you want to send an email then: 1. the function that actually sends emails gets called 2. it gets called once, not twice 3. it is called correctly, with the correct arguments You don't want your unit tests to actually send emails. You just want them to prove that the part of your machine that sends emails is being used correctly. Write a program that sends a random inspirational quote to an email address. The email address should be a command-line parameter passed to the program. You should have a list of quotes in a file by itself. Your program should grab one and send the email. Your final email quotes should be formatted like this: "The only true measure of success if the number of people you have helped" Ray Dalio Node After npm init you should add your own script to package.json. Look for scripts inside the file. you should be able to do the following: npm run send_inspiration ... The command needs to allow you to pass in an email address from the command line. Take a look at this Also note that good code is written to be reusable. Make sure all your executable code is inside useful functions. When we run npm run send_inspiration then the right functions will need to be executed. Python You should be able to run your code using python send_inspiration.py ... The command needs to allow you to pass in an email address from the command line. Take a look at this Go with the simplest option you can find initially - because KISS Also note that good code is written to be reusable. Make sure all your executable code is inside useful functions. When we run npm run send_inspiration then the Also note that good code is written to be reusable. Make sure all your executable code is inside useful functions. When we run npm run send_inspiration then the right functions will need to be executed. Testing your project Your unit tests should make sure that when the application runs then it sends one email with one quote to one person. If your tests send actual emails require your smtp secret values then they are wrong. Please make sure that you understand what mocks and spies are for when writing your tests. These things do not exist to take up space, waste time or look fancy. They do have a purpose. If you do anything that looks like the following pseudocode then you are doing it wrong: spyon (myFunction) myFunction() assert myFunction wasCalleonce Here is a useful way to think about mocks and spies: Basically, sending emails is considered "expensive". Why? Because it costs actual money if you do it in bulk. Also it costs time. It is not a fast and free operation. But it is an important operation. You need to test that when you want to send an email then: 1. the function that actually sends emails gets called 2. it gets called once, not twice 3. it is called correctly, with the correct arguments You don't want your unit tests to actually send emails. You just want them to prove that the part of your machine that sends emails is being used correctly

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!