
Python Advanced
Comprehensive Professional Course for Advanced Python Concepts
What you'll learn
- Understand object-oriented programming, class and object
- Use the Constructor, variables and functions inside a class
- Apply inheritance and the abstract class
- Work with Enum, json and modules
- Work with the time and date module
- Open files, read them and write to them
- Handle errors and exceptions
- Connect to a database and create tables
- Add, edit and delete data in a database
- Build practical applications on the advanced tasks
About this course
This course teaches the advanced tasks in Python for anyone who has finished the basics and wants to build larger programs. It starts with object-oriented programming: class and object, the constructor, the difference between Class Variable and Instance Variable, Class Method and Static Method, and access control, then inheritance in its types, the abstract class and Enum. Next you learn json, modules and the time and date module, then working with files by opening, reading, writing to and deleting them, and handling errors with Finally and else. You then move to databases: tables, connecting to a database, and adding, reading, editing and deleting data. At the end come practical applications, a guessing game, working with images and screenshots, and recording audio. The course suits anyone who knows the basics of Python and wants the next level. Each lesson explains one idea with a simple example so you understand it before moving on. By the end, you will be able to build organized programs with classes that work with files and databases.
Expected outcomes
- Ability to implement advanced projects using Python.
- Manage files and handle errors efficiently.
- Understand the fundamentals of object-oriented programming and implement practical applications.
- Create databases and connect them to programming projects.
Learner reviews
Course content
1The Model
4 lectures
- The Module (Part One)Explains a Module as a py file that can be reused in another file, how to bring it in with import, and how to reach its functions and variables through the Module name.8:59
- The Module (Part Two)Continues with Modules, covering importing specific items directly with from import without writing the Module name, and giving a Module a shorter alias using as.13:20
- The Module (Part Three)Explains a Package as a folder grouping several Modules, ways to import functions from it using the Package and Module names, with an example of sum, subtraction and info-printing functions.11:14
- Handling the Time and Date ModuleExplains Python's date and time modules such as time, calendar and datetime, and goes through the calendar module's functions for displaying calendars and the valid ranges of day, month and year.21:24
2File Handling
5 lectures
- Introduction to File HandlingIntroduces file handling in Python, showing that files persist data unlike variables held in RAM that vanish when the program ends, and outlines four operations: opening, reading, writing and closing a file.7:13
- Opening a FileExplains opening a file in Python with the open function, what it needs such as the file name or path and the mode like r for read, w for write and a for append, and storing the result in a variable.18:39
- Reading File ContentExplains reading file content with read, either fully or a set number of characters, reading line by line with readline, looping over lines with a for loop, and closing the file afterwards.12:12
- Writing Data to a FileExplains writing data to a file in two modes: w, which erases the old content and writes anew, and a, which keeps the content and appends at the end, with the file created automatically if missing.10:49
- Deleting a FileExplains deleting a file from Python using the os module and its remove function, first checking that the file exists with os.path.exists to avoid an error, and printing a deletion confirmation.8:47
3Handling Errors
4 lectures
- Error HandlingExplains the two kinds of errors in Python, Syntax Error and Exception, the sources of exceptions such as user input or server connections, and handling them with try and except.14:54
- Handling Multiple ExceptionsExplains handling more than one exception: repeating input when data is invalid, catching specific types such as ZeroDivisionError in separate except blocks, and adding a general except for other exceptions.14:42
- Using FinallyExplains finally with try and except: its code runs whether the try succeeds or an exception occurs, which is useful for cleaning up resources such as closing files and database connections.7:19
- Using ElseExplains using else with try and except, where its code runs only when try succeeds without an exception, separating error-prone code from the rest, with an example checking a key in a dictionary.18:35
4Object-Oriented Programming
20 lectures
- Introduction to Object-Oriented ProgrammingIntroduces Object Oriented Programming and why it is needed when managing lots of data such as company employees instead of scattered variables, with the Class as a template describing an object's attributes and actions.9:00
- Class and Object (Part One)Clarifies the relationship between Class and Object: the Class is a template describing properties and methods, and the Object is an actual instance created from it by instantiation, using a company employee example.21:17
- Class and Object (Part Two)Continues the Class and Object example with a car model having company, model, max speed and year attributes, then creating an Object from it and reaching its attributes with dot notation.8:30
- ConstructorExplains the Constructor, the init method that runs automatically when an Object is created and receives data to assign to its attributes, using self to refer to the Object itself.15:28
- Difference Between Class Variable and Instance VariableExplains the difference between a Class Variable and an Instance Variable in Python, how each is accessed, and what happens when the value is changed through the class or through the object.14:38
- First ExerciseA hands-on exercise with Class Variables and Instance Variables in an Employee class, such as an employee counter that grows with each new object, and giving an instance variable a default value without taking it in the constructor.11:33
- Assigning Some Functions to the ClassExplains defining functions inside a class so they become methods, using self to call them from an object, and customizing how an object is displayed when printed instead of the default output.14:32
- What is Instance AttributesExplains instance attributes in Python, how to read and change them directly, and how the built-in functions hasattr, setattr, getattr and delattr check, modify and delete them.19:18
- Some Class AttributesCovers the built-in attributes of a Python class such as the docstring, dict and module, and shows that every class automatically inherits from the base class object.18:02
- What is Class Method DecoratorExplains the Class Method decorator and converting an instance method into a class method when it only relies on class variables, and why an error occurs if it depends on instance variables.16:02
- Dealing with Static MethodExplains the Static Method, a function inside a class that takes neither self nor cls, how to call it from the class name or an object, and how it differs from instance and class methods.8:15
- Dealing and Defining Access PermissionsExplains access modifiers public, protected and private in Python using underscores, protecting data inside a class, and using getters and setters to read and modify values safely.13:18
- InheritanceExplains inheritance between a Parent class and a Child class, how the child reuses properties and methods without rewriting them, and how super gives access to the parent.14:10
- First Type of InheritanceExplains single inheritance with an Animal class and Dog and Cat classes that inherit from it, each adding its own methods such as bark and meow.11:48
- Second Type of InheritanceExplains multilevel inheritance, where a class inherits from a class that itself inherits from another, using Animal, then Dog, then Rex Dog, and passing values up through the levels.10:55
- Third Type of InheritanceExplains multiple inheritance in Python, where a class inherits from more than one class, and introduces isinstance and issubclass to check how an object or class relates to another.9:02
- Controlling and Changing Function PerformanceExplains method overriding, where a child class defines a method with the same name as its parent's method to behave differently, and which version actually gets called.6:44
- Abstract ClassExplains the abstract class as a blueprint for child classes that cannot be instantiated, using the abc module, with a full-time and part-time employee example that computes pay differently.24:06
- What is EnumExplains Enum in Python for grouping unique constants under one name, such as colors, accessing each member's name and value, and the fact that members cannot be modified.22:05
- Explaining JSONExplains the JSON format and how to work with it in Python using the json module, converting JSON text into Python data with loads and converting data into JSON text with dumps.12:02
5Databases
7 lectures
- Introduction to DatabasesIntroduces databases as a way to store data, the difference between relational SQL types such as SQLite and non-relational ones such as MongoDB, and table relationships such as one to one and one to many.9:35
- Tables in the DatabaseExplains the structure of database tables: a database named after the project holds tables, each table has columns with set data types and rows that represent records, leading into CRUD operations.15:03
- Connecting to the DatabaseExplains connecting to an SQLite database from Python by importing the sqlite3 module and calling connect with a file name, which opens the database if it exists and creates it otherwise.8:42
- Creating TablesExplains creating tables in SQLite from Python by running a CREATE TABLE statement through execute, defining column names and data types such as TEXT and INTEGER, and creating two tables in one database.12:22
- Inserting Data into the DatabaseExplains how to insert data into a SQLite table from Python using a cursor and the execute method, and why commit is required to save the changes.12:00
- Retrieving Data from the DatabaseExplains retrieving data from a database table through the cursor, and the differences between fetchone, fetchmany and fetchall, including how each continues from where the previous call stopped and what it returns.15:57
- Modifying and Deleting Data in the DatabaseExplains updating and deleting data in database tables using the cursor with UPDATE and DELETE statements, why the WHERE clause is needed to target specific rows, and committing to save the changes.9:35
6Advanced Tasks
6 lectures
- Task Application - Part OneStarts building a to-do application that works with a database, validating user input with strip and lower, then separating the show, add, update and delete functions into their own file.16:30
- Task Application - Part TwoContinues the task application with SQLite, creating the table, adding a task with a title and progress percentage, saving changes and closing the connection, then testing the add feature and validating user input.18:13
- Task Application - Part ThreeContinues the task application by implementing the update function to change a task's title and progress in the database, fixing errors along the way, with SELECT queries using fetchone and fetchall, and wiring it to the app.16:48
- Guessing GameA number guessing game project where the computer picks a random number within a user-set range, using the random module, a while loop, a guess limit calculated with a logarithm, and comparison of each guess.25:57
- Handling Images and Taking ScreenshotsA project writing a Python script that captures a screenshot using the pyscreenshot library and its grab function, saves the image through the Pillow library, and installs the external libraries with pip.12:55
- Handling Audio and Recording SoundA Python project for recording audio on the computer, covering installing an audio library, setting the sample rate and recording duration, and saving the recording to a wave file.16:13
7The Accessories
2 attachments
- Downloading Database Section Attachments
- Downloading Advanced Tasks Section Attachments
Instructor

Eng. Amr Abdel Fattah
This course is part of the diploma




