8 | Split Python Code into Files: import and Modules for Testers
Description: Learn how to split Python code into files and import it, the same way test frameworks are organised. Built on the cart project.
In this lesson:
- Move code into its own file (a module)
- Use it from another file with import
- Keep your project tidy and easy to run
- Keep __pycache__ out of Git with .gitignore
Previous lesson: Python Lists and Dictionaries for Testers https://youtu.be/FC8N2hLvHJo
Next lesson: Python String Functions for Testers https://youtu.be/sVXPwMURpqE
Free course on Udemy, with two short quizzes: https://www.udemy.com/course/python-and-git-for-testers-learn-coding-for-test-automation/?referralCode=DDD96CB2D94250E08531
Full playlist, in order: https://www.youtube.com/playlist?list=PLbdk4_6KQS2o
Code for this course: https://github.com/anuradha-learn/python-pytest-bridge
Website: https://anuradhaagarwal.com
LinkedIn: https://www.linkedin.com/in/anuradhaagarwal
About me: I am Anuradha Agarwal, a test automation specialist and trainer with decades of industry and teaching experience, and a Master's degree in Data Science. This channel is about modern QA testing. Subscribe if you want more lessons like this.
If this lesson helped you, write one line in the comments about what you built or what you got stuck on. Close description
In this lesson:
- Move code into its own file (a module)
- Use it from another file with import
- Keep your project tidy and easy to run
- Keep __pycache__ out of Git with .gitignore
Previous lesson: Python Lists and Dictionaries for Testers https://youtu.be/FC8N2hLvHJo
Next lesson: Python String Functions for Testers https://youtu.be/sVXPwMURpqE
Free course on Udemy, with two short quizzes: https://www.udemy.com/course/python-and-git-for-testers-learn-coding-for-test-automation/?referralCode=DDD96CB2D94250E08531
Full playlist, in order: https://www.youtube.com/playlist?list=PLbdk4_6KQS2o
Code for this course: https://github.com/anuradha-learn/python-pytest-bridge
Website: https://anuradhaagarwal.com
LinkedIn: https://www.linkedin.com/in/anuradhaagarwal
About me: I am Anuradha Agarwal, a test automation specialist and trainer with decades of industry and teaching experience, and a Master's degree in Data Science. This channel is about modern QA testing. Subscribe if you want more lessons like this.
If this lesson helped you, write one line in the comments about what you built or what you got stuck on. Close description




