GithubHelp home page GithubHelp logo

x-evolve / python_hunt Goto Github PK

View Code? Open in Web Editor NEW
17.0 0.0 18.0 44.1 MB

This is an amazing website for learning python!

Home Page: https://python-hunt.vercel.app

Python 3.33% HTML 50.08% CSS 22.34% JavaScript 24.24% Shell 0.02%
hacktoberfest hacktoberfest2023

python_hunt's Introduction

My Image

Python Hunt is an OpenSource Website ๐Ÿ’™

Hello opensource developers! We have initiated a website called Python Hunt to make learning python even more easier. This is a Django project where you can contribute web pages explaining various concepts in python as mentioned in issues. Make sure that the templates must have same kind of design everywhere to maintain uniformity. Please refer the below documentation for running the website on your system.

Add your HTML Pages here:

producthunt_pro/products/templates/products/

To know more about how to add the pages, click here!

Kindly consider leaving a โญ if you like the repository

Happy Coding!

Prerequisites

Before installing Django, ensure that you have the following prerequisites installed on your system:

  • Python (version 3.6 or higher)
  • pip (Python package installer)

Installation Steps

  1. Create a virtual environment (optional)

    It's recommended to create a virtual environment to isolate your Django project's dependencies. Open your terminal or command prompt and execute the following command:

    python3 -m venv myenv

    Replace myenv with the desired name for your virtual environment.

  2. Activate the virtual environment (optional)

    Activate the virtual environment by running the appropriate command for your operating system:

    Windows:

    myenv\Scripts\activate

    Unix or Linux:

    source myenv/bin/activate
  3. Install Django

    With your virtual environment activated, execute the following command to install Django using pip:

    pip install django

    This command will download and install the latest stable version of Django.

  4. Verify the installation

    To verify that Django is successfully installed, run the following command:

    django-admin --version

    You should see the installed Django version printed in the console.

Congratulations! You have successfully installed Django on your system. You are now ready to start building your Django web applications.

Running this system in your local system

  1. Fork this repository and move inside it

    git clone https://github.com/X-Evolve/Python_Hunt.git && producthunt_pro
  2. Next, use this command for migrating changes to the models

    python manage.py migrate
  3. Running the Website on your Local Host

    To run the website on your local host, use the following command:

    python manage.py runserver
  4. Last Step

    Click on the url produced and it opens in your default browser

Congratulations! You have successfully setup your Django Web Server on your local host. You are now ready to contribute!

Getting Started with Contributions

  1. Checkout to a new branch to work on an issue

    git checkout -b new_work
  2. Once you have completed coding, then open a Pull Request(PR)

    From the root of the project, Run the following commands:

    • Add your contributions to the branch

      git add .
    • Commit the contributions you made to the branch

      git commit -m "prefix: Description of your work (short one is preferred)"

      Add the following prefixes depending on your contributions:

      • fix: A bug fix
      • feat: A new feature
      • docs: Documentation changes
      • chore: Miscellaneous changes that do not match any of the above.

    • Push your contributions to your branch:

      git push origin new_work

    Open your forked repository in your browser and then raise a Pull Request (PR) to the main branch of this repository!

How to Add your files in the project

If you want to add CSS or Javascript or Image files in this project, add it in static folder:

producthunt_pro/producthunt/static/

Import them into the code by using this:

(On the top of the HTML File)

#Imports the base template
{% extends 'base.html' %} 
{% block content %} 
    
#Load the static files added in the folder above
{% load static %}

(When you want to use your CSS / Javascript file)

href = "{% static 'name of the file' %}"

(When you want to use your image file)

src = "{% static 'name of the file' %}"

(After you have finished your HTML page, add the below code at the end of the file)

{% endblock %}

Notes:

  • Do design your HTML pages with respect to the base template.
    For more reference, check the other pages designed so far.
  • The importance of including the base template is that it has the default navbar and footer which makes it easier to navigate through the pages.

Additional Resources

Contact

For any questions or support, reach out to the lead maintainers:

python_hunt's People

Contributors

akshwin avatar an-array avatar builderprid avatar dependabot[bot] avatar dheekshithbg avatar dikshant182004 avatar fortunebush avatar irfansalim avatar karthikakshaj avatar marufhasan24 avatar miran-firdausi avatar mismathh avatar pulkitxm avatar ravin-d-27 avatar sriram-ramakrishnan avatar umesh9-prog avatar vadalisravani avatar vishwassaini25 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python_hunt's Issues

Create a Web Page for "Loops and Iterative Statements"

Create a Webpage which explains about For loop and While loop.
It should have sample code snippets which explains the concepts pretty well.
HTML page should be uniform, please have a look at other pages and create it.

Refer to README.md and make the PR.

Create a Web Page for "Python Keywords"

It should display All Keywords in tabular form along with One line information about it.
Also, add some code snippets for some important keywords according to your preference

Create a HTML file for "Errors, Exceptions and Debugging"

Here are some topics for Errors, Exceptions, and Debugging in Python:

  1. Syntax Errors: These occur when the code violates the rules of Python's syntax.

  2. Runtime Errors (Exceptions): These occur during the execution of the program. Some common exceptions include:

    • ZeroDivisionError
    • NameError
    • TypeError
    • ValueError
    • IndexError
  3. Handling Exceptions: This involves using try, except, else, and finally blocks to handle exceptions gracefully.

  4. Raising Exceptions: You can manually raise exceptions using the raise keyword.

  5. Custom Exceptions: Creating your own exception classes to handle specific situations.

  6. Assertion Errors: These occur when an assert statement fails.

  7. Debugging Tools: Utilizing tools like pdb (Python debugger) to step through code and identify issues.

  8. Tracebacks: Understanding the information provided in the traceback to locate the source of an error.

  9. Logging: Using the logging module to record information about program behavior.

  10. Unit Testing and Test Cases: Writing and executing tests to verify the correctness of your code.

  11. Static Code Analysis (Optional): Tools like pylint or flake8 that help identify potential issues in your code.

  12. Common Debugging Techniques: Techniques like print statements, logging, and using a debugger to find and fix bugs.

  13. Handling Multiple Exceptions: Dealing with situations where multiple types of exceptions can occur.

  14. Resource Cleanup with Context Managers (Optional): Using with statements and context managers to ensure resources are properly released.

  15. Debugging in Specific Environments (Optional): Understanding how to debug in environments like Jupyter notebooks or web frameworks.

Create a web page for "Functions"

Refer to README.md and start with introduction to Functions.

  1. Defining Functions: Understanding how to create and define functions in Python.

  2. Parameters and Arguments: Learning how to pass data into functions using parameters and arguments.

  3. Return Values: Knowing how to use the return statement to send data back from a function.

  4. Scope: Understanding the concept of local and global scope in Python functions.

  5. Lambda Functions: Creating anonymous functions using the lambda keyword.

  6. Built-in Functions: Familiarizing yourself with common built-in functions like len(), range(), str(), etc.

  7. Higher-order Functions: Working with functions that can take other functions as arguments or return them as values.

  8. Decorators: Using decorators to extend the behavior of functions without modifying their code.

  9. Modules and Packages: Organizing functions into modules and packages for better code management.

  10. Error Handling in Functions: Implementing error handling strategies within functions.

Footer in not stuck to the bottom

While I was working on another webpage i realised that the footer is not stuck to the bottom of the page which can be done using just 1 line.
Although all pages are more than 100vh and this doesn't show it still is a problem.
Let me know if this need to be done.
Assign this to me if this is found relevant.

Create a web page for Stacks in Python

This page should include the core definition and concepts of stack with examples.
It should also contain the code by which stack can be implemented in python .

Create a Webpage for "Python Variables"

1)Explain what are variables in python
2)How to create a variable in python
3)Casting the type of variable
4)Explain about case sensitivity of variables in Python

Update the Documentation

Please update the folder structure diagram in README.md of Python Hunt to current folder structure.

Design the "python_variables.html"

Refer to other HTML pages and redesign the mentioned page uniformly.

Also, in mobile view, it is not properly aligned
image

Fix this issue as well.

Create a Webpage for "File Handling"

Refer to README.md file and cover the below topics

  1. Opening and Closing Files:

    • open()
    • close()
  2. Reading Files:

    • read()
    • readline()
    • readlines()
  3. Writing to Files:

    • write()
    • writelines()
  4. Appending to Files:

    • append()
  5. File Modes:

    • r (Read)
    • w (Write)
    • a (Append)
    • b (Binary)
    • x (Create)
  6. Working with Binary Files:

    • rb
    • wb
    • ab
  7. File Attributes:

    • name
    • mode
  8. Navigating within Files:

    • seek()
    • tell()
  9. Error Handling with Files:

    • try and except for file-related errors
  10. Using with Statement:

    • Automatic file closing
  11. Working with Text and Binary Files:

    • open() with t and b modes
  12. Working with CSV Files:

    • Using the csv module
  13. Working with JSON Files:

    • Using the json module
  14. Working with XML Files:

    • Using libraries like xml.etree.ElementTree
  15. Working with Excel Files:

    • Using libraries like pandas, openpyxl, xlrd, xlwt, etc.
  16. Managing Directories:

    • os module for directory operations
  17. File Metadata:

    • os.path for file-related information
  18. File Handling Best Practices:

    • Properly closing files
    • Using with statement for automatic cleanup

Design tuples.html page

Refer to other HTML Pages and make the tuples.html look uniform.
Add Navbar to it as well, with required stylings.

Create a webpage for "Dictionaries"

Create a Web Page to explain Dictionary concepts clear.

A key-value pair is a combination of a unique identifier (key) and an associated value. The key is used to access the corresponding value.

Unordered Collection:
Dictionaries in Python are unordered, meaning there's no guarantee that elements will be in a specific order. This is different from lists or tuples where elements are ordered by index.

Mutable:
Dictionaries are mutable, which means their content can be changed after creation. You can add, modify, or delete key-value pairs.

Hashing:
Dictionaries use a hashing function to map keys to their corresponding values. This allows for efficient retrieval of values based on their keys.

Keys must be Immutable:
Keys in a dictionary must be of an immutable data type (e.g., strings, numbers, tuples). This is because the key needs to be hashable.

Unique Keys:
Each key in a dictionary must be unique. If you try to add a key that already exists, the existing value will be overwritten.

Accessing Values by Key:
You can retrieve the value associated with a key by using the square bracket notation (my_dict[key]). If the key is not present, it will raise a KeyError.

Dictionary Methods:
Python provides various methods for dictionaries, including get(), items(), keys(), values(), pop(), popitem(), update(), etc. These methods offer a range of operations for working with dictionaries.

in Operator:
The in operator allows you to check if a specific key exists in the dictionary. For example, key in my_dict will return True if key is present.

Length of a Dictionary:
You can find the number of key-value pairs in a dictionary using the len() function.

Dictionary Comprehensions:
Like lists, dictionaries can be created using comprehensions, which provide a concise way to construct dictionaries.

Nested Dictionaries:
Dictionaries can contain other dictionaries as values. This allows for more complex data structures.

Iterating Over Dictionaries:
You can loop through the keys, values, or items (key-value pairs) of a dictionary using loops or comprehensions.

Default Values:
The get() method allows you to provide a default value if the key is not found in the dictionary. This prevents a KeyError.

Copying Dictionaries:
Dictionaries can be copied using methods like copy(). Be careful when copying as it creates a new reference, not a new copy of the dictionary.

Dictionary View Objects:
dict.keys(), dict.values(), and dict.items() return view objects that provide a dynamic view on the dictionary's keys, values, and key-value pairs respectively.

Dictionary Merging:
The update() method can be used to merge two dictionaries. If there are overlapping keys, the values from the second dictionary overwrite the values from the first.

Create a web page for Strings

Create a web page for Strings. Remember to put HTML pages in products/templates/products and CSS and JS files in producthunt/static

  1. String Basics:

    • Creating strings
    • Single-quoted vs double-quoted strings
    • Triple-quoted strings
  2. String Operations:

    • Concatenation
    • Repetition
    • Indexing
    • Slicing
  3. String Methods:

    • len(): Returns the length of a string.
    • str.lower(), str.upper(): Converts the string to lowercase or uppercase.
    • str.capitalize(), str.title(): Capitalizes the first character of a string or capitalizes each word.
    • str.strip(), str.lstrip(), str.rstrip(): Removes whitespace characters from the beginning and end of a string.
    • str.split(): Splits a string into a list of substrings based on a delimiter.
    • str.join(): Joins a list of strings into one string using a specified delimiter.
    • str.replace(): Replaces occurrences of a substring with another substring.
    • str.find(), str.index(): Searches for a substring and returns its position.
    • str.count(): Counts the occurrences of a substring.
    • str.startswith(), str.endswith(): Checks if a string starts or ends with a specified substring.
    • str.isalpha(), str.isdigit(), str.isalnum(), etc.: Checks for specific character types.
    • str.encode(), str.decode(): Converts strings to bytes and vice versa.
  4. Escape Characters:

    • Special characters like newline \n, tab \t, backslash \\, etc.
  5. String Comparison:

    • Comparison operators (==, !=, <, <=, >, >=)
  6. Immutable Nature of Strings:

    • Strings cannot be changed in-place. To make modifications, you need to create a new string.
  7. String Concatenation vs Joining:

    • Understanding the difference between using + and str.join() for combining strings.
  8. String Slicing and Indexing (Advanced):

    • Negative indexing, stepping, and extended slicing.

Refer to README.md for more information

Create a web page for Queues in Python

This page should include the core definition and concepts of queue with examples.
It should also contain the code by which queue can be implemented in python .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.