Advanced Python Detailed Index PDF
Advanced Python Detailed Index PDF
I NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in
DETAILED INDEX
֍ OOP’s Part – 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 1
⚽ What is Class? …………………………………………………………………………………….………………. 2
⚽ How to define a Class? ……………………………………………………………………………………….. 2
⚽ What is Object? ………………………………………………………………………………………………….. 3
⚽ What is Reference Variable? …………………………………………………………………………….... 3
⚽ Self Variable ……………………………………………………………………………………………………….. 4
⚽ Constructor Concept …………………………………………………………………………………………… 4
⚽ Differences between Methods and Constructors ………………………………………………… 6
II NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in
⚽ Setter and Getter Methods …………………………..…………………….……………………………. 20
⚽ Passing Members of One Class to Another Class ……………………...………………………..23
⚽ Inner Classes …………………………………………………………………………………………………….. 24
⚽ Garbage Collection ……………………………………………………………………………………………. 27
⚽ How to enable and disable Garbage Collector in our Program ……………………….…. 27
⚽ Destructors ……………………………..……………………………………………………………………….. 28
⚽ How to find the Number of References of an Object ……..…………………………………. 29
III NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in
֍ OOP’s Part – 3 ~~~~~~~~~~~~~~~~~~~~~~~~~ 58
⚽ Polymorphism ………………………………….……………………………………………………………….. 59
⚽ Duck Typing Philosophy of Python ………….…………………………………………………………. 59
⚽ Overloading ……………………………………………………………………..………………………………… 62
☕ Operator Overloading
☕ Method Overloading
☕ Constructor Overloading
⚽ Overriding ………………………………………………………………………………………………………….. 68
☕ Method Overriding
☕ Constructor Overriding
IV NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in
⚽ else Block with try-except-finally ……………………………………………………………..…. 96
⚽ Various possible Combinations of try-except-else-finally ………………………..…… 97
⚽ Types of Exceptions ………………………………………….………………………………………. 101
☕ Predefined Exceptions
☕ User Definded Exceptions
⚽ How to Define and Raise Customized Exceptions …………………..………………..… 102
V NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in
֍ Multi Threading ~~~~~~~~~~~~~~~~~~~~~~~ 123
⚽ Multi Tasking ………………………………………………………………………………………….… 124
☕ Process based Multi Tasking
☕ Thread based Multi Tasking
⚽ The ways of Creating Thread in Python ……………………………………………………… 125
☕ Creating a Thread without using any class
☕ Creating a Thread by extending Thread class
☕ Creating a Thread without extending Thread class
⚽ Setting and Getting Name of a Thread ………………………………………………………. 127
⚽ Thread Identification Number (ident) ………………………………………………………… 128
⚽ enumerate() Function ……………………………………………………………………………….. 129
⚽ isAlive() Method ……………………………………………………………………………………..… 130
⚽ join() Method ……………………………………………………………………………………………. 130
⚽ Daemon Threads ………………………………………………………………………………………. 132
⚽ Default Nature ………………………………………………………………………………………….. 133
⚽ Synchronization ………………………………………………………………………………………... 134
☕ Lock
☕ RLock
☕ Semaphore
⚽ Synchronization By using Lock Concept ……………………………………………………… 135
⚽ Problem with Simple Lock …………………………………………………………………….…… 136
⚽ Demo Program for Synchronization by using RLock …………………………………… 137
⚽ Difference between Lock and RLock ……………………………………………………..…… 138
⚽ Synchronization by using Semaphore ………………………………………………………… 138
⚽ Bounded Semaphore ………………………………………………………………………………... 140
⚽ Difference between Lock and Semaphore ……………………………………………….… 140
⚽ Inter Thread Communication ……………………………………………………………..……… 141
⚽ Inter Thread Communication by using Event Objects ………………………………… 141
⚽ Methods of Event Class ……………………………………………………………………………… 141
☕ set()
☕ clear()
☕ isSet()
☕ wait()|wait(seconds)
⚽ Inter Thread Communication by using Condition Object ………………………….… 143
VI NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in
⚽ Methods of Condition ……………………………………………………………………………….. 143
☕ acquire()
☕ release()
☕ wait()|wait(time)
☕ notify()
☕ notifyAll()
⚽ Case Study ………………………………………………………………………………………………... 144
⚽ Inter Tread Communication by using Queue ……………………………………………… 146
⚽ Important Methods of Queue …………………………………………………………………… 146
☕ put()
☕ get()
⚽ Types of Queues ……………………………………………………………………………………….. 147
☕ FIFO Queue
☕ LIFO Queue
☕ Priority Queue
⚽ Good Programming Practices with usage of Locks ……………………………………… 148
VII NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in
֍ Regular Expressions & Web Scraping ~~~~~~~~~ 166
⚽ Character Classes …………………………………………………………………………………….… 168
⚽ Pre defined Character Classes ……………………………………………………………………. 169
⚽ Qunatifiers ………………………………………………………………………………………………… 169
⚽ Important Functions of Remodule …………………………………………………………..… 170
1) match()
2) fullmatch()
3) search()
4) findall()
5) finditer()
6) sub()
7) subn()
8) split()
9) compile()
⚽ Web Scraping by using Regular Expressions …………………………………………….… 177
VIII NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in
֍ Python Logging ~~~~~~~~~~~~~~~~~~~~~~~ 193
⚽ Logging Levels …………………………………………………………………………………………. 194
⚽ How to implement Logging ……………………………………………………………………… 194
⚽ How to configure Log File in over writing Mode ………………………………………. 196
⚽ How to Format Log Messages ………………………………………………………………….. 196
⚽ How to add Timestamp in the Log Messages ……………………………………………. 197
⚽ How to Change Date and Time Format …………………………………………………….. 197
⚽ How to write Python Program Exceptions to the Log File …………………………. 198
⚽ Problems with Root Logger ……………………………………………………………………… 199
⚽ Need of Our Own Customized Logger ………………………………………………………. 200
⚽ Advanced logging Module Features: Logger …………………………………………….. 200
⚽ Logger with Configuration File …………………………………………………………………. 203
⚽ Creation of Custom Logger ………………………………………………………………………. 205
⚽ How to Create seperate Log File based on Caller ……………………………………… 206
⚽ Advantages of Customized Logger ……………………………………………………………. 208
IX NARESH IT, 2nd Floor, Durga Bhavani Complex, Satyam Threater Rd, Ameerpet, HYD
Telangana-500016 | Tel:+91 40 2374 6666 | Ph:+91 90009 94007 | www.nareshit.in