Skip to content

Commit

Permalink
test deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
CagriCatik committed Jan 22, 2025
1 parent 093e26a commit 2658737
Show file tree
Hide file tree
Showing 51 changed files with 85 additions and 18 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/01_OOP.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Object Oriented Programming in Python
# Object Oriented Programming

OOP is a programming paradigm that changes our approach to coding by organizing data and functionality into reusable structures called classes.

Expand Down
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/03_init.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Understanding the `__init__` Method in Python
# `__init__` Method

In Python, the `__init__` method is a crucial part of object initialization within a class. Often referred to as a constructor, this special method gets called automatically when an object is created, enabling the setup of initial values and other necessary actions. This tutorial aims to provide a comprehensive understanding of the `__init__` method and its significance in Python programming.

Expand Down
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/04_self.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Understanding the `self` Parameter in Python Classes
# `self` Parameter

In Python, the `self` parameter is an integral part of defining instance methods in a class. It allows each instance of the class to keep its own data and functionality separate from other instances. This tutorial aims to provide a comprehensive understanding of the `self` parameter and its importance in Python object-oriented programming.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Understanding Class and Instance Attributes in Python
# Class and Instance Attributes

In object-oriented programming, classes and instances play a pivotal role. Python, being an object-oriented language, leverages classes to define objects and their behavior. An important aspect of this paradigm is understanding the distinction between class attributes and instance attributes. This tutorial will provide a comprehensive examination of these concepts, their differences, and how to utilize them effectively in Python.

Expand Down
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/06_Dunder_Methods.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Utilizing Dunder Methods in Classes
# Dunder Methods

In this tutorial, we will explore the concept of dunder methods, also known as magic methods, and their application in Python classes. Dunder methods, short for "double underscore" methods, are special methods with double leading and trailing underscores (e.g., `__init__`). These methods are integral to defining the behavior of objects in Python. While we've already encountered the `__init__` method for initializing instances, we will delve deeper into other dunder methods that enhance the functionality and interactivity of our classes.

Expand Down
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/07_str()_repr().md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Comprehensive Tutorial on `str()` and `repr()` in Python
# `str()` and `repr()`

In Python, `str()` and `repr()` are two functions that convert an object into a string. However, they serve distinct purposes and are used in different contexts. Understanding the differences between them is crucial for writing clear and effective Python code. This tutorial provides an in-depth examination of `str()` and `repr()`, illustrating their uses and differences with code snippets and examples.

Expand Down
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/08__eq__().md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Implementing Object Comparison in Python with the `__eq__` Method
# `__eq__` Method

Object-oriented programming (OOP) in Python offers a powerful way to structure and organize code. One essential aspect of OOP is the ability to compare objects meaningfully. By default, Python compares objects based on their memory addresses, which might not always be the desired behavior, especially when dealing with objects that encapsulate data. To customize this comparison, Python provides the `__eq__` method, also known as the equality dunder method.

Expand Down
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/09_Methods_Functions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Understanding Functions and Methods in Python: A Detailed Tutorial
# Functions and Methods

In Python, functions and methods are fundamental constructs that enable code modularity, reusability, and organization. While they might seem similar at first glance, they have distinct characteristics and use cases. This tutorial provides a comprehensive explanation of functions and methods, highlighting their differences through examples.

Expand Down
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/11_Inheritance.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Inheritance in Python
# Inheritance

Object-Oriented Programming is a programming paradigm that uses objects and classes to organize and structure code. It allows for modularity, reusability, and abstraction. Python, as an object-oriented language, supports OOP features, including inheritance, polymorphism, encapsulation, and abstraction. This tutorial will focus on the principles of OOP, specifically inheritance, in Python.

Expand Down
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/12_super().md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Understanding `super()`
# `super()`

In Python's Object-Oriented Programming (OOP) paradigm, the `super()` function is a crucial component for managing class inheritance hierarchies. This tutorial aims to provide a comprehensive and detailed explanation of `super()`, its use cases, and potential pitfalls.

Expand Down
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/[email protected]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `@staticmethod` in Python
# `@staticmethod`

In Python, methods within a class can be defined in various ways depending on their intended use. Among these, the `@staticmethod` decorator is used to define methods that do not operate on an instance of the class or the class itself. This tutorial will cover the functionality, use cases, and implementation of `@staticmethod`, along with a critical examination of its benefits and limitations.

Expand Down
4 changes: 1 addition & 3 deletions webpage/docs/guide/07_OOP/[email protected]
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# @classmethod

## Classes and Instances
# Classes and Instances

A class in Python serves as a blueprint for creating objects (instances). Each object is an instance of a class and can have attributes (data) and methods (functions) that define its behavior.

Expand Down
2 changes: 1 addition & 1 deletion webpage/docs/guide/07_OOP/[email protected]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Abstract Methods and Classes in Python
# Abstract Methods and Classes

This tutorial provides an in-depth exploration of abstract methods and abstract classes in Python. These concepts are essential for creating structured and reusable code in object-oriented programming. Abstract classes allow developers to define blueprints for other classes, enforcing a consistent interface without implementing the functionality themselves. This ensures that derived classes adhere to a specific structure, which can be critical in larger and more complex software systems.

Expand Down
4 changes: 1 addition & 3 deletions webpage/docs/guide/07_OOP/16_Name_Mangling.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Understanding Name Mangling

## Introduction to Name Mangling
# Name Mangling

Name mangling is a mechanism in Python to ensure that the names of class attributes are unique and not easily accessible outside their defining class. This feature is particularly useful for encapsulating data and preventing name clashes in inheritance hierarchies.

Expand Down
Empty file.
71 changes: 71 additions & 0 deletions webpage/docs/guide/15_File-Management/11_toml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
## Using YAML with Python

### Introduction to YAML

YAML (YAML Ain't Markup Language) is a human-readable data serialization format. It is commonly used for configuration files, data exchange between applications, and also as a language-independent alternative to XML or JSON. YAML's simplicity and readability make it popular among developers.

### YAML Syntax

YAML uses indentation and whitespace to represent data structures. It supports various data types including mappings (key-value pairs), sequences (arrays/lists), strings, integers, floats, booleans, null values, and more.

Here's a basic example of YAML syntax:

```yaml
key1: value1
key2: value2
nested_key:
- item1
- item2
```
### Installing PyYAML
PyYAML is a Python library that allows you to work with YAML files. To install PyYAML, you can use pip, Python's package manager:
```bash
pip install pyyaml
```

### Reading YAML Files in Python

You can use the `yaml` module in Python to read YAML files. The `yaml.safe_load()` function is commonly used to safely load YAML data from a file or a string.

```python
import yaml

with open('data.yaml', 'r') as file:
data = yaml.safe_load(file)

print(data)
```

### Writing YAML Files in Python

To write data to a YAML file in Python, you can use the `yaml.dump()` function. It serializes Python data into a YAML formatted string.

```python
import yaml

data = {
'key1': 'value1',
'key2': [1, 2, 3],
'key3': {'nested_key': 'nested_value'}
}

with open('output.yaml', 'w') as file:
yaml.dump(data, file)
```

### Advanced Usage

#### Handling Custom Objects

PyYAML supports serialization and deserialization of custom objects. You can define custom `representer` and `constructor` functions to handle serialization and deserialization of custom objects respectively.

#### Handling Anchors and Aliases

YAML allows the use of anchors (`&`) and aliases (`*`) to reference the same data elsewhere in the document. PyYAML provides support for handling anchors and aliases during parsing and dumping YAML data.

### Conclusion

YAML is a versatile data serialization format that is widely used in the software development community. With PyYAML, you can easily work with YAML files in Python, enabling seamless integration of YAML data into your Python applications. Whether you're reading configuration files, exchanging data between systems, or storing structured data, YAML combined with Python offers a powerful and flexible solution.

0 comments on commit 2658737

Please sign in to comment.