Problem 4.1 Reverse Engineering

I need help with this. I have include slides needed. I am confused how to do this python. If you could please include everything needed.
Part I
Scenario: Novice hackers are trying to write Python code with a malicious code segment injected to attack.
Step 1: Write a simple Python code. For example, a code is shown on slide 6.
Step 2: Contribute to add malicious code. The code should be setting up your local host web server. A sample code is on slides 17-18.
Step 3: Compile a Python to be executable$python -m py_compile
Step 4: Assume that your .pyc file is distributed, meaning that it infects others. Run the file and see if index.html is generated.
Step 5: Run the byproduct file index.html
Step 6: Uncompile an executable to Python source code as explained on slide 11.$uncompyle6