As we conclude, here is a list of questions for you to test your knowledge regarding this chapter's material. You will find the answers in the Assessments section of the book:
- What is the main reason why you should always use a virtual environment for your Python projects?
- Do you need to or should you place the virtual environment folder (that is, venv) under version control?
- Why create a requirements.txt file?
- You need to run a Python script as the root user. What step must you take to ensure that the script executes in its intended virtual environment context?
- What does the source venv/bin/activate command do?
- You are in an activated virtual environment. What is the command to leave the virtual environment and return to the host shell?
- You created a Python project and virtual environment in PyCharm. Can you work on and run the project's Python scripts in a Terminal?
- You want a GUI tool to edit and test Python code on your Raspberry Pi but do not have PyCharm installed. What pre-installed tool that comes with Python and Raspbian could you use?
- You've advanced in your Python and electronics knowledge and are trying to hook up a device using I2C to your Raspberry Pi but you cannot get it to work. What might be the problem and how do you address it?