Python
133 articles in this category.
- All
- Basic Python Full Course 84
- Python Notes 22
- OOPs concepts in Python 21
- Basic Python Full Course 4
-
Python modules: import styles, aliases, reload, random and __name__
What a Python module is and how to use one: the four import styles, module and member aliases, dir() and help(), reloading a changed module, the random module, and the special __name__ variable, with tested output.
-
Python database programming: the DB-API, SQLite, queries and safe parameters
How Python talks to databases: the standard steps (connect, cursor, execute, fetch, commit, close), parameterised queries against SQL injection, transactions and errors, shown on SQLite with notes for MySQL and Oracle.
-
Python logging: levels, handlers, formatters and configuration
Replace print debugging with the logging module: levels, basicConfig, formatting, writing to files, logging exceptions, named loggers and handlers, filters and dictConfig, with tested output.
-
Python operators: arithmetic, comparison, logical, bitwise, assignment and more
Every Python operator explained with tested examples: arithmetic, comparison and chained comparison, logical short-circuiting, bitwise and shift, assignment, ternary, identity, membership, precedence and the math module.
-
Python multithreading: threads, locks, semaphores, events and queues
How to run work in several threads in Python: creating and joining threads, daemon threads, race conditions, Lock and RLock, semaphores, Event, Condition, Queue, thread pools, and the GIL limitation.
-
Python regular expressions: the re module, patterns, groups and flags
A practical guide to regular expressions in Python: character classes, quantifiers, anchors, the main re functions, groups, flags, greedy versus lazy matching, lookarounds and real patterns, with tested output.
-
Python modules and packages: import, __init__.py, relative imports and __name__
How Python organises code: modules, packages, __init__.py, absolute and relative imports, running a file as a script versus importing it, the search path and the errors you will meet, with a runnable example.
-
Python sets: unique items, set operations and frozenset
How Python sets work: creating them, adding and removing items, union, intersection and difference, membership speed, frozenset, set comprehensions, and practical uses like removing duplicates.
-
Python strings: indexing, slicing, methods and formatting
A complete tour of the Python str type: literals, indexing and slicing, searching, replacing, splitting and joining, case and character checks, formatting with f-strings, and Unicode basics, all with tested output.
-
Python tuples: creation, immutability, packing, unpacking and tuple vs list
What a tuple is, how to create and access one, why it is immutable (and the catch), packing and unpacking, tuple comprehension myths, namedtuple, and when to choose a tuple over a list.
-
Python language fundamentals: identifiers, keywords, data types and type casting
The building blocks of every Python program: naming rules for identifiers, reserved words, the built-in data types, number systems, type conversion and constants, with tested examples.
-
Python language fundamentals: what Python is, its features and your first program
A beginner's introduction to Python: where it came from, what makes it different from Java and C, its main features and limits, where it is used, how to install it, run code and write your first working programs.