diff --git a/code-guide/17_GUI/test.py b/code-gui/test.py similarity index 100% rename from code-guide/17_GUI/test.py rename to code-gui/test.py diff --git a/webpage/docs/guide/15_File-Management/01_File-Handling/code/example.py b/code-guide/15_File-Management/01_File-Handling/code/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/01_File-Handling/code/example.py rename to code-guide/15_File-Management/01_File-Handling/code/example.py diff --git a/webpage/docs/guide/15_File-Management/01_File-Handling/code/sample_text.txt b/code-guide/15_File-Management/01_File-Handling/code/sample_text.txt similarity index 100% rename from webpage/docs/guide/15_File-Management/01_File-Handling/code/sample_text.txt rename to code-guide/15_File-Management/01_File-Handling/code/sample_text.txt diff --git a/webpage/docs/guide/15_File-Management/02_Reading-Files/code/example.py b/code-guide/15_File-Management/02_Reading-Files/code/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/02_Reading-Files/code/example.py rename to code-guide/15_File-Management/02_Reading-Files/code/example.py diff --git a/webpage/docs/guide/15_File-Management/02_Reading-Files/code/sample_text.txt b/code-guide/15_File-Management/02_Reading-Files/code/sample_text.txt similarity index 100% rename from webpage/docs/guide/15_File-Management/02_Reading-Files/code/sample_text.txt rename to code-guide/15_File-Management/02_Reading-Files/code/sample_text.txt diff --git a/webpage/docs/guide/15_File-Management/03_Writing-Creating-Files/code/example.py b/code-guide/15_File-Management/03_Writing-Creating-Files/code/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/03_Writing-Creating-Files/code/example.py rename to code-guide/15_File-Management/03_Writing-Creating-Files/code/example.py diff --git a/webpage/docs/guide/15_File-Management/03_Writing-Creating-Files/code/new_file.txt b/code-guide/15_File-Management/03_Writing-Creating-Files/code/new_file.txt similarity index 100% rename from webpage/docs/guide/15_File-Management/03_Writing-Creating-Files/code/new_file.txt rename to code-guide/15_File-Management/03_Writing-Creating-Files/code/new_file.txt diff --git a/webpage/docs/guide/15_File-Management/03_Writing-Creating-Files/code/sample_text.txt b/code-guide/15_File-Management/03_Writing-Creating-Files/code/sample_text.txt similarity index 100% rename from webpage/docs/guide/15_File-Management/03_Writing-Creating-Files/code/sample_text.txt rename to code-guide/15_File-Management/03_Writing-Creating-Files/code/sample_text.txt diff --git a/webpage/docs/guide/15_File-Management/04_Deleting-Files/code/README.md b/code-guide/15_File-Management/04_Deleting-Files/code/README.md similarity index 100% rename from webpage/docs/guide/15_File-Management/04_Deleting-Files/code/README.md rename to code-guide/15_File-Management/04_Deleting-Files/code/README.md diff --git a/webpage/docs/guide/15_File-Management/04_Deleting-Files/code/example.py b/code-guide/15_File-Management/04_Deleting-Files/code/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/04_Deleting-Files/code/example.py rename to code-guide/15_File-Management/04_Deleting-Files/code/example.py diff --git a/webpage/docs/guide/15_File-Management/05_JSON/code/example.py b/code-guide/15_File-Management/05_JSON/code/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/05_JSON/code/example.py rename to code-guide/15_File-Management/05_JSON/code/example.py diff --git a/webpage/docs/guide/15_File-Management/06_Handling-JSON/code/example.py b/code-guide/15_File-Management/06_Handling-JSON/code/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/06_Handling-JSON/code/example.py rename to code-guide/15_File-Management/06_Handling-JSON/code/example.py diff --git a/webpage/docs/guide/15_File-Management/07_Caching-JSON/code/api.json b/code-guide/15_File-Management/07_Caching-JSON/code/api.json similarity index 100% rename from webpage/docs/guide/15_File-Management/07_Caching-JSON/code/api.json rename to code-guide/15_File-Management/07_Caching-JSON/code/api.json diff --git a/webpage/docs/guide/15_File-Management/07_Caching-JSON/code/comments.csv b/code-guide/15_File-Management/07_Caching-JSON/code/comments.csv similarity index 100% rename from webpage/docs/guide/15_File-Management/07_Caching-JSON/code/comments.csv rename to code-guide/15_File-Management/07_Caching-JSON/code/comments.csv diff --git a/webpage/docs/guide/15_File-Management/07_Caching-JSON/code/comments.json b/code-guide/15_File-Management/07_Caching-JSON/code/comments.json similarity index 100% rename from webpage/docs/guide/15_File-Management/07_Caching-JSON/code/comments.json rename to code-guide/15_File-Management/07_Caching-JSON/code/comments.json diff --git a/webpage/docs/guide/15_File-Management/07_Caching-JSON/code/example.py b/code-guide/15_File-Management/07_Caching-JSON/code/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/07_Caching-JSON/code/example.py rename to code-guide/15_File-Management/07_Caching-JSON/code/example.py diff --git a/webpage/docs/guide/15_File-Management/07_Caching-JSON/code/example_api.py b/code-guide/15_File-Management/07_Caching-JSON/code/example_api.py similarity index 100% rename from webpage/docs/guide/15_File-Management/07_Caching-JSON/code/example_api.py rename to code-guide/15_File-Management/07_Caching-JSON/code/example_api.py diff --git a/webpage/docs/guide/15_File-Management/07_Caching-JSON/code/test-csv.py b/code-guide/15_File-Management/07_Caching-JSON/code/test-csv.py similarity index 100% rename from webpage/docs/guide/15_File-Management/07_Caching-JSON/code/test-csv.py rename to code-guide/15_File-Management/07_Caching-JSON/code/test-csv.py diff --git a/webpage/docs/guide/15_File-Management/08_Glob/code/example.py b/code-guide/15_File-Management/08_Glob/code/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/08_Glob/code/example.py rename to code-guide/15_File-Management/08_Glob/code/example.py diff --git a/webpage/docs/guide/15_File-Management/08_Glob/code/test1.js b/code-guide/15_File-Management/08_Glob/code/test1.js similarity index 100% rename from webpage/docs/guide/15_File-Management/08_Glob/code/test1.js rename to code-guide/15_File-Management/08_Glob/code/test1.js diff --git a/webpage/docs/guide/15_File-Management/08_Glob/code/test2.js b/code-guide/15_File-Management/08_Glob/code/test2.js similarity index 100% rename from webpage/docs/guide/15_File-Management/08_Glob/code/test2.js rename to code-guide/15_File-Management/08_Glob/code/test2.js diff --git a/webpage/docs/guide/15_File-Management/08_Glob/code/test3.js b/code-guide/15_File-Management/08_Glob/code/test3.js similarity index 100% rename from webpage/docs/guide/15_File-Management/08_Glob/code/test3.js rename to code-guide/15_File-Management/08_Glob/code/test3.js diff --git a/webpage/docs/guide/15_File-Management/08_Glob/code/test4.js b/code-guide/15_File-Management/08_Glob/code/test4.js similarity index 100% rename from webpage/docs/guide/15_File-Management/08_Glob/code/test4.js rename to code-guide/15_File-Management/08_Glob/code/test4.js diff --git a/webpage/docs/guide/15_File-Management/09_Pickling/code/example.py b/code-guide/15_File-Management/09_Pickling/code/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/09_Pickling/code/example.py rename to code-guide/15_File-Management/09_Pickling/code/example.py diff --git a/webpage/docs/guide/15_File-Management/09_Pickling/code/library.pickle b/code-guide/15_File-Management/09_Pickling/code/library.pickle similarity index 100% rename from webpage/docs/guide/15_File-Management/09_Pickling/code/library.pickle rename to code-guide/15_File-Management/09_Pickling/code/library.pickle diff --git a/webpage/docs/guide/15_File-Management/10_yaml/example.py b/code-guide/15_File-Management/10_yaml/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/10_yaml/example.py rename to code-guide/15_File-Management/10_yaml/example.py diff --git a/webpage/docs/guide/15_File-Management/10_yaml/example.yaml b/code-guide/15_File-Management/10_yaml/example.yaml similarity index 100% rename from webpage/docs/guide/15_File-Management/10_yaml/example.yaml rename to code-guide/15_File-Management/10_yaml/example.yaml diff --git a/webpage/docs/guide/15_File-Management/11_toml/config.toml b/code-guide/15_File-Management/11_toml/config.toml similarity index 100% rename from webpage/docs/guide/15_File-Management/11_toml/config.toml rename to code-guide/15_File-Management/11_toml/config.toml diff --git a/webpage/docs/guide/15_File-Management/11_toml/example.py b/code-guide/15_File-Management/11_toml/example.py similarity index 100% rename from webpage/docs/guide/15_File-Management/11_toml/example.py rename to code-guide/15_File-Management/11_toml/example.py diff --git a/webpage/docs/guide/07_OOP/01_OOP.md b/webpage/docs/guide/07_OOP/01_OOP.md index f6d75b02..008ea1e0 100644 --- a/webpage/docs/guide/07_OOP/01_OOP.md +++ b/webpage/docs/guide/07_OOP/01_OOP.md @@ -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. diff --git a/webpage/docs/guide/07_OOP/03_init.md b/webpage/docs/guide/07_OOP/03_init.md index 3a4b2c92..d6a8c21e 100644 --- a/webpage/docs/guide/07_OOP/03_init.md +++ b/webpage/docs/guide/07_OOP/03_init.md @@ -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. diff --git a/webpage/docs/guide/07_OOP/04_self.md b/webpage/docs/guide/07_OOP/04_self.md index 8b0a8aad..ac9ee57b 100644 --- a/webpage/docs/guide/07_OOP/04_self.md +++ b/webpage/docs/guide/07_OOP/04_self.md @@ -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. diff --git a/webpage/docs/guide/07_OOP/05_Attributes_Class_and_Instance.md b/webpage/docs/guide/07_OOP/05_Attributes_Class_and_Instance.md index ec504869..6d790e77 100644 --- a/webpage/docs/guide/07_OOP/05_Attributes_Class_and_Instance.md +++ b/webpage/docs/guide/07_OOP/05_Attributes_Class_and_Instance.md @@ -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. diff --git a/webpage/docs/guide/07_OOP/06_Dunder_Methods.md b/webpage/docs/guide/07_OOP/06_Dunder_Methods.md index 4c39262f..8d76ebc8 100644 --- a/webpage/docs/guide/07_OOP/06_Dunder_Methods.md +++ b/webpage/docs/guide/07_OOP/06_Dunder_Methods.md @@ -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. diff --git a/webpage/docs/guide/07_OOP/07_str()_repr().md b/webpage/docs/guide/07_OOP/07_str()_repr().md index c6c3c078..fdc190bd 100644 --- a/webpage/docs/guide/07_OOP/07_str()_repr().md +++ b/webpage/docs/guide/07_OOP/07_str()_repr().md @@ -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. diff --git a/webpage/docs/guide/07_OOP/08__eq__().md b/webpage/docs/guide/07_OOP/08__eq__().md index 49d13729..3779d329 100644 --- a/webpage/docs/guide/07_OOP/08__eq__().md +++ b/webpage/docs/guide/07_OOP/08__eq__().md @@ -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. diff --git a/webpage/docs/guide/07_OOP/09_Methods_Functions.md b/webpage/docs/guide/07_OOP/09_Methods_Functions.md index 33cbbc0d..bcd9677f 100644 --- a/webpage/docs/guide/07_OOP/09_Methods_Functions.md +++ b/webpage/docs/guide/07_OOP/09_Methods_Functions.md @@ -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. diff --git a/webpage/docs/guide/07_OOP/11_Inheritance.md b/webpage/docs/guide/07_OOP/11_Inheritance.md index f9be39e4..9ca4a83e 100644 --- a/webpage/docs/guide/07_OOP/11_Inheritance.md +++ b/webpage/docs/guide/07_OOP/11_Inheritance.md @@ -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. diff --git a/webpage/docs/guide/07_OOP/12_super().md b/webpage/docs/guide/07_OOP/12_super().md index 59deba69..f9473fb7 100644 --- a/webpage/docs/guide/07_OOP/12_super().md +++ b/webpage/docs/guide/07_OOP/12_super().md @@ -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. diff --git a/webpage/docs/guide/07_OOP/13_@staticmethod.md b/webpage/docs/guide/07_OOP/13_@staticmethod.md index be39a82c..1695b8d9 100644 --- a/webpage/docs/guide/07_OOP/13_@staticmethod.md +++ b/webpage/docs/guide/07_OOP/13_@staticmethod.md @@ -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. diff --git a/webpage/docs/guide/07_OOP/14_@classmethod.md b/webpage/docs/guide/07_OOP/14_@classmethod.md index 34e73b31..299bf61e 100644 --- a/webpage/docs/guide/07_OOP/14_@classmethod.md +++ b/webpage/docs/guide/07_OOP/14_@classmethod.md @@ -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. diff --git a/webpage/docs/guide/07_OOP/15_@abstractmethod.md b/webpage/docs/guide/07_OOP/15_@abstractmethod.md index 50bae795..bdae5775 100644 --- a/webpage/docs/guide/07_OOP/15_@abstractmethod.md +++ b/webpage/docs/guide/07_OOP/15_@abstractmethod.md @@ -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. diff --git a/webpage/docs/guide/07_OOP/16_Name_Mangling.md b/webpage/docs/guide/07_OOP/16_Name_Mangling.md index 377c1669..2bb1e102 100644 --- a/webpage/docs/guide/07_OOP/16_Name_Mangling.md +++ b/webpage/docs/guide/07_OOP/16_Name_Mangling.md @@ -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. diff --git a/webpage/docs/guide/15_File-Management/05_JSON/README.md b/webpage/docs/guide/15_File-Management/04_Deleting_Files.md similarity index 100% rename from webpage/docs/guide/15_File-Management/05_JSON/README.md rename to webpage/docs/guide/15_File-Management/04_Deleting_Files.md diff --git a/webpage/docs/guide/15_File-Management/06_Handling-JSON/README.md b/webpage/docs/guide/15_File-Management/05_JSON.md similarity index 100% rename from webpage/docs/guide/15_File-Management/06_Handling-JSON/README.md rename to webpage/docs/guide/15_File-Management/05_JSON.md diff --git a/webpage/docs/guide/15_File-Management/06_Handling-JSON.md b/webpage/docs/guide/15_File-Management/06_Handling-JSON.md new file mode 100644 index 00000000..e69de29b diff --git a/webpage/docs/guide/15_File-Management/07_Caching-JSON/README.md b/webpage/docs/guide/15_File-Management/07_Caching-JSON.md similarity index 100% rename from webpage/docs/guide/15_File-Management/07_Caching-JSON/README.md rename to webpage/docs/guide/15_File-Management/07_Caching-JSON.md diff --git a/webpage/docs/guide/15_File-Management/08_Glob/README.md b/webpage/docs/guide/15_File-Management/08_Glob.md similarity index 100% rename from webpage/docs/guide/15_File-Management/08_Glob/README.md rename to webpage/docs/guide/15_File-Management/08_Glob.md diff --git a/webpage/docs/guide/15_File-Management/09_Pickling/README.md b/webpage/docs/guide/15_File-Management/09_Pickling.md similarity index 100% rename from webpage/docs/guide/15_File-Management/09_Pickling/README.md rename to webpage/docs/guide/15_File-Management/09_Pickling.md diff --git a/webpage/docs/guide/15_File-Management/10_yaml/README.md b/webpage/docs/guide/15_File-Management/10_yaml.md similarity index 100% rename from webpage/docs/guide/15_File-Management/10_yaml/README.md rename to webpage/docs/guide/15_File-Management/10_yaml.md diff --git a/webpage/docs/guide/15_File-Management/11_toml.md b/webpage/docs/guide/15_File-Management/11_toml.md new file mode 100644 index 00000000..4d62c0a2 --- /dev/null +++ b/webpage/docs/guide/15_File-Management/11_toml.md @@ -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.