Open Source Rhythmic Midi Generator for all Major Keys in Python

This program uses some relatively simple python logic to generate random chord progressions in every major key! The progressions are then broken up into rhythmic subunits, which are also semi-random.

The midi files need a specified directory to be outputted to. Where to do this can be found within the code.

Any and all feedback is appreciated!

Link to the code: [https://github.com/prod-emdub/midirhythm/tree/main](https://github.com/prod-emdub/midirhythm/tree/main)

&#x200B;

Here is an example of a randomly generated progression in F major:

&#x200B;

https://preview.redd.it/usbt91cd5js81.png?width=3541&format=png&auto=webp&s=eb5513343eb5bccf4bdda2ad40eac07ba1355af6


Build a Site Connectivity Checker in Python – Real Python


I made an R6 Strat Roulette discord bot in python!

Hey I'm fairly new to python this is one of my first actual projects! If you want to talk to me about it or give me some suggestions add me on discord: Axkkzy#7992 :)

[https://github.com/Axkkzy/R6-Strat-Roulette-Bot](https://github.com/Axkkzy/R6-Strat-Roulette-Bot)


Free Python Course Inquiry

 I had a quick question regarding a coursera class I am currently taking for simple python programming (it's offered for free and it looks like the course is laid out fairly well).

However, after week 1 (so a few hours I've invested), it appears to be a course that may have been recycled/offered to newbies from original posting date of several years ago and not within the past 2 years (I found comments from students reviewing the course from 2016).

The teaching style is a little inflexible at times (jumping around functions, assignments a bit), but I want to get through the course because of the value of learning to work with Python

Is there value in this particular program based on the age of the course or do I need to restart a similar course not older than a certain amount of years? They are working with python 3.4 btw

&#x200B;

Thanks for any feedback/recommendations!


Python client for Crunchbase's REST API

Hi, I recently needed to use [Crunchbase](https://www.crunchbase.com/)'s REST API in a project but couldn't find a well-maintained python client for it. I started writing one and decided to open-source it. This is my first open-sourced project. Your feedback, improvements, and suggestions will be appreciated.

[https://pypi.org/project/py-crunchbase-api/](https://pypi.org/project/py-crunchbase-api/)

Thanks.


What do you guys think of this book?


custom-literals A module implementing custom literal suffixes using pure Python


Python — Network Tracking using Wireshark and Google Maps


A Hitomezashi pattern generator I made in python!

I made a Hitomezashi stitch pattern generator fully in python after watching the Numberphile video a long time ago. I used the pygame module to do it.

Source Code- [https://github.com/Topkinsme/Hitomezashi-Stitch-Pattern-Generator/blob/main/main.py](https://github.com/Topkinsme/Hitomezashi-Stitch-Pattern-Generator/blob/main/main.py)

https://reddit.com/link/tzp0f4/video/sorpps5wsgs81/player


When default __new__ function should be overwritten?

I recently learnt about diffrence beetween __new__ and __init__ functions, but I cannot find usecase of writing my own __new__ method.


Pygame Tutorial - Menus and Buttons!


Internship skills:

I’m pretty new to python. All i’ve done is take a dual enrollment class at gt for it and the farthest we covered in the course is project oriented learning. I understand how to do the basic problems in the class like given an array of movies and their gross profit, sort them from greatest profit to least profit. Simple things like that. What can i do to learn how to actually apply this stuff to the point that i would be useful in an internship??


Saturday Daily Thread: Resource Request and Sharing! Daily Thread

Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?

Use this thread to chat about and share Python resources!


Shortening common parts of code

Title.

In JavaScript there are things like the ternary operator to reduce code size and "improve" code quality, I'm wondering if there is much in python aside from the obvious which is lambda


I created a library for teacher task automation

I created a library of utilities I've used as a teacher to automate various tasks (mail merges, interacting with google classroom, generating rubrics). I hope that it might lower the barrier of entry for teachers with some python knowledge to get started with using programming to ease the repetitive aspects of our work.

Comments, criticism, and code review are much appreciated!

https://pypi.org/project/teacherhelper/

https://teacherhelper.jackdevries.com/

https://github.com/jdevries3133/teacher_helper


Using Github to host local images permenently on the web.

When you create an issue or add an image on github, you can actually upload images to the github server without any external apis. We can use this feature to mimic Github's behavior when uploading an image and upload any local image to the web. Because github has to store all images permenently (or images on READMEs or issues could change), we also do not have to worry about uploaded images expiring.

I have been using this feature (although not automatically) for a long time to host images for my own website, and finally managed to automate this process.

Honestly, as a beginner in programming, hosting images for websites for free is a pain in the ass and I hope this will help people learn more about websites.

[Github link](https://github.com/0ev/github-issue-image-upload)


Wordle in command line

you can wide the dictionary if you want 😉

    from os import system, name
    import re
    import random

    # define our clear function
    def clear():

        if name == 'nt': # for windows
            system('cls')
        else: # for mac and linux(here, os.name is 'posix')
            system('clear')

    #show the rules of the game and descripcion
    def menu():

        print("""
        __        __            _ _         ____
        \ \      / /__  _ __ __| | | ___   / ___| __ _ _ __ ___   ___
         \ \ /\ / / _ \| '__/ _` | |/ _ \ | |  _ / _` | '_ ` _ \ / _ \\
          \ V  V / (_) | | | (_| | |  __/ | |_| | (_| | | | | | |  __/
           \_/\_/ \___/|_|  \__,_|_|\___|  \____|\__,_|_| |_| |_|\___|
        Try to guess the word, we lend you some clues when you assert.
        After each guess, the color of the tiles will change to show how close your guess was to the word
        """)

    def show_words(array_words,guessword):

        for word in array_words:
            list_blocks = ""
            for i,letter in enumerate(word):
                if letter in guessword:
                    if word[i] == guessword[i]:
                        block = "🟩"
                    else:
                        block = "🟨"
                else:
                    block = "🔲"

                list_blocks += block

            print(word.replace("", " ")[1: -1])
            print(list_blocks)

    if __name__ == "__main__":
        dictionary = ["ninja","great","witch","grown","space","stone","earth","extra","entry","slice","shine","sharp","eager","ebony","penny"]
        guessword = random.choice(dictionary)
        lenword = len(guessword)
        word_guessed = False
        array_words = []

    while word_guessed == False:
        clear()
        menu()
        show_words(array_words,guessword)
        try:
            word = input(f"Hit some word of {lenword} length here:")

            if len(word) != lenword:
                raise ValueError(f"it must be {lenword} length word!")
            elif not re.search(r"[a-zA-Z]{"+str(lenword)+"}",word):
                raise ValueError(f"it must be only alfabetical characters!")
            elif word == guessword:
                print(word.replace("", " ")[1: -1])
                print("🟩🟩🟩🟩🟩")
                print("Awesome! 🎉🎉🎉")
                word_guessed = True
            else:
                array_words.append(word)

        except ValueError as e:
            print(e)
            a = input("Press 'enter' to continue")


so im 30 switching careers from automotive to computers started college for computer science learning python 3 but i feel its going kinda slow learning so much though so i figured I would ask the more knowledgeable people on what i can do in my free time to grow my knowledge more


Preferred way to connect to a database

Is it a particular ORM, do you use a particular ODBC library, embracing the bleeding edge of speed with Apache Arrow?

What satisfies your data source access needs and why?


Unix Command Cheat Sheet for Busy Developers


Scrape Google Play Search Apps in Python

Hey guys, just in case anyone wants to scrape Google Play Store App Search 👀

Full code:

```python
from bs4 import BeautifulSoup
from serpapi import GoogleSearch
import requests, json, lxml, re, os

def bs4_scrape_all_google_play_store_search_apps(
                                          query: str,
                                          filter_by: str = "apps",
                                          country: str = "US"):
    # https://docs.python-requests.org/en/master/user/quickstart/#passing-parameters-in-urls
    params = {
        "q": query,     # search query
        "gl": country,  # country of the search. Different country display different apps.
        "c": filter_by  # filter to display list of apps. Other filters: apps, books, movies
    }

    # https://docs.python-requests.org/en/master/user/quickstart/#custom-headers
    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.79 Safari/537.36",
    }

    html = requests.get("https://play.google.com/store/search", params=params, headers=headers, timeout=30)
    soup = BeautifulSoup(html.text, "lxml")

    apps_data = []

    for app in soup.select(".mpg5gc"):
        title = app.select_one(".nnK0zc").text
        company = app.select_one(".b8cIId.KoLSrc").text
        description = app.select_one(".b8cIId.f5NCO a").text
        app_link = f'https://play.google.com{app.select_one(".b8cIId.Q9MA7b a")["href"]}'
        developer_link = f'https://play.google.com{app.select_one(".b8cIId.KoLSrc a")["href"]}'
        app_id = app.select_one(".b8cIId a")["href"].split("id=")[1]
        developer_id = app.select_one(".b8cIId.KoLSrc a")["href"].split("id=")[1]

        try:
            # https://regex101.com/r/SZLPRp/1
            rating = re.search(r"\d{1}\.\d{1}", app.select_one(".pf5lIe div[role=img]")["aria-label"]).group()
        except:
            rating = None

        thumbnail = app.select_one(".yNWQ8e img")["data-src"]

        apps_data.append({
            "title": title,
            "company": company,
            "description": description,
            "rating": float(rating) if rating else rating, # float if rating is not None else rating or None
            "app_link": app_link,
            "developer_link": developer_link,
            "app_id": app_id,
            "developer_id": developer_id,
            "thumbnail": thumbnail
        })

    print(json.dumps(apps_data, indent=2, ensure_ascii=False))

bs4_scrape_all_google_play_store_search_apps(query="maps", filter_by="apps", country="US")

def serpapi_scrape_all_google_play_store_apps():
    params = {
        "api_key": os.getenv("API_KEY"),  # your serpapi api key
        "engine": "google_play",          # search engine
        "hl": "en",                       # language
        "store": "apps",                  # apps search
        "gl": "us",                       # contry to search from. Different country displays different.
        "q": "maps"                       # search qeury
    }

    search = GoogleSearch(params)  # where data extracts
    results = search.get_dict()    # JSON -> Python dictionary

    apps_data = []

    for apps in results["organic_results"]:
        for app in apps["items"]:
            apps_data.append({
                "title": app.get("title"),
                "link": app.get("link"),
                "description": app.get("description"),
                "product_id": app.get("product_id"),
                "rating": app.get("rating"),
                "thumbnail": app.get("thumbnail"),
                })

    print(json.dumps(apps_data, indent=2, ensure_ascii=False))
```

Output from DIY solution:

```json
[
  {
    "title": "Google Maps",
    "company": "Google LLC",
    "description": "Real-time GPS navigation & local suggestions for food, events, & activities",
    "rating": 3.9,
    "app_link": "https://play.google.com/store/apps/details?id=com.google.android.apps.maps",
    "developer_link": "https://play.google.com/store/apps/dev?id=5700313618786177705",
    "app_id": "com.google.android.apps.maps",
    "developer_id": "5700313618786177705",
    "thumbnail": "https://play-lh.googleusercontent.com/Kf8WTct65hFJxBUDm5E-EpYsiDoLQiGGbnuyP6HBNax43YShXti9THPon1YKB6zPYpA=s128-rw"
  },
  {
    "title": "Google Maps Go",
    "company": "Google LLC",
    "description": "Get real-time traffic, directions, search and find places",
    "rating": 4.3,
    "app_link": "https://play.google.com/store/apps/details?id=com.google.android.apps.mapslite",
    "developer_link": "https://play.google.com/store/apps/dev?id=5700313618786177705",
    "app_id": "com.google.android.apps.mapslite",
    "developer_id": "5700313618786177705",
    "thumbnail": "https://play-lh.googleusercontent.com/0uRNRSe4iS6nhvfbBcoScHcBTx1PMmxkCx8rrEsI2UQcQeZ5ByKz8fkhwRqR3vttOg=s128-rw"
  },
  {
    "title": "Waze - GPS, Maps, Traffic Alerts & Live Navigation",
    "company": "Waze",
    "description": "Save time on every drive. Waze tells you about traffic, police, crashes & more",
    "rating": 4.4,
    "app_link": "https://play.google.com/store/apps/details?id=com.waze",
    "developer_link": "https://play.google.com/store/apps/developer?id=Waze",
    "app_id": "com.waze",
    "developer_id": "Waze",
    "thumbnail": "https://play-lh.googleusercontent.com/muSOyE55_Ra26XXx2IiGYqXduq7RchMhosFlWGc7wCS4I1iQXb7BAnnjEYzqcUYa5oo=s128-rw"
  }, ... other results
]
```

Full blog post with step-by-step explanation: https://serpapi.com/blog/scrape-google-play-search-apps-in-python/


Rock-Paper-Scissors-Lizard-Spock Game

    from random import randint
    # create a list of play options
    options = ["Rock", "Paper", "Scissors", "Lizard", "Spock"]

    play = True

    while play == True:

        computer = options[randint(0, 4)]
        user_input = input("Please select; Rock, Paper, Scissors, Lizard or Spock\n")
        u = user_input.lower()

        player = u.capitalize()

        print("Player: ", player)
        print("Computer: ", computer)

        ##Tie
        if player == computer:
            print("Tie!")

        ##Rock
        elif player =="Rock":
            if computer == "Paper":
                print("You lose!", computer, "covers", player)
            elif computer == "Scissors":
                print("You win!", player, "smashes", computer)
            elif computer == "Lizard":
                print("You win!", player, "crushes", computer)
            elif computer == "Spock":
                print("You lose!", computer, "vaporizes", player)

        ##Paper
        elif player =="Paper":
            if computer == "Scissors":
                print("You lose!", computer, "cuts", player)
            elif computer =="Rock":
                print("You win!", player, "covers", computer)
            elif computer == "Lizard":
                print("You lose!", computer , "eats", player)
            elif computer == "Spock":
                print("You win!", player, "disproves", computer)

        ##Scissors
        elif player == "Scissors":
            if computer == "Paper":
                print("You win!", player, "cuts", computer)
            elif computer == "Rock":
                print("You lose!", computer, "crushes", player)
            elif computer =="Lizard":
                print("You win!", player, "decapitates", computer)
            elif computer == "Spock":
                print("You lose!", computer, "smashes", player)

        ##Lizard
        elif player == "Lizard":
            if computer =="Rock":
                print("You lose!", computer, "crushes", player)
            elif computer =="Paper":
                print("You win!", player, "eats", computer)
            elif computer == "Scissors":
                print("You lose!", computer, "decapitates", player)
            elif computer == "Spock":
                print("You win!", player, "", computer)

        ##Spock
        elif player == "Spock":
            if computer == "Rock":
                print("You win!", player, "vaporizes", computer)
            elif computer == "Paper":
                print("You lose!", computer, "disproves", player)
            elif computer == "Scissors":
                print("You win!", player, "smashes", computer)
            elif computer == "Lizard":
                print("You lose!", computer, "poisons", player)

        print("Would you like to play again? \n")
        answer =input()

        if answer.lower() =="y" or answer.lower() =="yes":
            play == True
        else:
            break

&#x200B;

&#x200B;

This is a game I made a while back, link; [https://github.com/WillPhillipsCVdemo/Rock-Paper-Scissors-Lizard-Spock/blob/master/Game.py](https://github.com/WillPhillipsCVdemo/Rock-Paper-Scissors-Lizard-Spock/blob/master/Game.py)


MicroPython pro-tip: Use WebREPL within your IDE

The repetitive process of editing your code in Thonny IDE, switching over to the WebREPL window, re-selecting your edited code file, re-sending it to your ESP32, and going back to Thonny to fix any bugs can get cumbersome and slow.

Here's a visual tutorial on how to use WebREPL within Thonny. Hope it helps you!

[https://bhave.sh/micropython-webrepl-thonny/](https://bhave.sh/micropython-webrepl-thonny/)


br4nch 2.0 - Currently in development!

After recieving alot of helpful feedback and feature requests, I have decided to start the development of version 2.0 for br4nch!

*Please visit:* [*https://br4nch.com*](https://br4nch.com) *for helpful links.*

&#x200B;

**Here are some of the upcoming features:**

* Renewing alot of arguments and crucial functions. ⚠
* Adding a new 'load.json' function that imports a complete json data file.
* Adding a new 'export.json' function that exports a branch to a json data file.
* Adding a new 'list.branches' function.
* Adding a new 'list.nodes' function.
* Adding an improved algorithm to search for new updates for br4nch.
* Adding support for more python versions.
* Updating documentation.
* Rewritting alot of other functions.

# 💙💛


Favorite Python Web Framework

Django
FastAPI
Flask
Masonite
Bottle
…other?

Also discuss why


Does clean code equal "Workplace" code

I am a beginner at python and have been following Angela Yu's 100 days of python. I commented on a post regarding my Coffee Machine code been some 400 lines while hers was around 150 lines with the same functionilty.

&#x200B;

This led me to ask this question of, if code works does it matter if it's clean and pythonic.

&#x200B;

I will reference these two tic toe games below:

&#x200B;

18000 lines (no adherence to DRY but simple to understand)

[https://github.com/asweigart/my\_first\_tic\_tac\_toe/blob/9f38b04e857426c5a5b80919ad0b5fce0947c022/tictactoe.py](https://github.com/asweigart/my_first_tic_tac_toe/blob/9f38b04e857426c5a5b80919ad0b5fce0947c022/tictactoe.py)

&#x200B;

1 line (I was shocked that such a thing was even possible, considering my tic tac toe code was around 500 lines with no AI. This code is in my opinion way way to complex and one would probably be working in the realm of datasciences/ML to understand such a thing)

[https://www.reddit.com/r/Python/comments/9ozfeq/tictactoe\_in\_one\_line\_python35/](https://www.reddit.com/r/Python/comments/9ozfeq/tictactoe_in_one_line_python35/)

&#x200B;

Both programs work, but if one was given only the option of picking from the two, which would be preffered in the workplace? In my opinion, the 18000 line code would be acceptable as it allows all team members, novice or not to atleast have some understanding.

&#x200B;

EDIT: Better late than never, but I realised I have been referencing my tic tac toe code of 500 lines vs the 1 and 18000 liners but havent posted it for comparison.

So here it is (I do acknowledge that a tic tac toe game has no relevance to the workplace, but is the code structure I used somewhere along the lines of "hirable".):

[https://pastebin.com/GBCRiGWe](https://pastebin.com/GBCRiGWe)


**Creating 3D Maps with Python (feat.Mapbox)**
[https://wooiljeong.github.io/python/mapboxgl\_map/](https://wooiljeong.github.io/python/mapboxgl_map/)

Using WGL provided by Mapbox with Python, I visualized apartment prices in Seoul, Korea on a 3D map. The description of the implementation method is in Korean, but the code is also recorded, so there is no difficulty in understanding it.

https://preview.redd.it/qcnyr389t9s81.png?width=919&format=png&auto=webp&s=d9e1997e4f95119926a04aaa09492a11a3c2be60


Backgammon Game

A game of backgammon. Written with Python and Cython. I'm interested in artificial intelligence so this program has an ai and can play against itself. It uses the monte-carlo tree search algorithm.

https://preview.redd.it/xhkqm66ej8s81.png?width=802&format=png&auto=webp&s=60007f6b59c5471f70b98234be65aa6a9201a551

[https://github.com/Tracing/python-backgammon](https://github.com/Tracing/python-backgammon)


Best 20 Python Program only for Beginners

The Python programming language is one of the most used languages in the world, especially in data analytics. There are many different types of Python projects that you can do. Some of the most common Python project ideas are listed in this blog.

Source Code: [https://www.myguideinfo.com/search/label/python-projects](https://www.myguideinfo.com/search/label/python-projects)

**The 20 Best Python Projects only for Beginners**

1. Finding Mean, Median, Mode in Python without libraries
2. Program to Find LCM of two numbers in Python
3. Find Duplicate Values using Python
4. Python Program to Check Prime Number
5. Find Greater Number Using If Function In Python
6. Taking Multiple User's Input Using While Loop in Python
7. Create a Digital Clock In Python With Source Code
8. Create To-Do List Using Python with Source Code
9. Python Program to Display Calendar with Source Code
10. Create a Password Generator In Python with Source Code
11. Python Program to Print all Prime Numbers in an Interval
12. Python Program to Find the Sum of Natural Numbers
13. Python Program to Find the Factorial of a Number
14. Calculate the Area of a Triangle in Python
15. Python Program to Create a Countdown Timer
16. Python Program to add two Matrices, Transpose, and Multiply
17. Contact Management Project In Python With Source Code
18. Billing System Project In Python With Source Code
19. Vehicle Inventory System In Python With Source Code
20. Library Management System In Python with Source Code

Source Code: [https://www.myguideinfo.com/search/label/python-projects](https://www.myguideinfo.com/search/label/python-projects)


I'm 13, trying to learn Python.

Where/what do you think I should start, learn first, or do you just have any tips?

Also, make sure what ever you're suggesting is free. Please.


Friday Daily Thread: Free chat Friday! Daily Thread

Use this thread to talk about anything Python related! Questions, news,  projects and any relevant discussion around Python is permitted!


With the very little Python experience I have, I coded this little “game” of uno.

[link to the python code](https://www.onlinegdb.com/Z0no-dI4B)


Automate Investopedia stock simulator with Investopedia-bot

I made this [program](https://github.com/bassel27/Investopedia-Bot) which allows you to automate Investopedia and compare the stocks you're interested in to take better decisions. What do you think?


Abandoned Docker Library?

Apologies if this isn't the right forum to raise this. I'm hoping folks here might have some insight or can point me in the right direction. I have a build tool that relies on the official Docker library for Python:

[https://github.com/docker/docker-py](https://github.com/docker/docker-py)

It seems like this library has been mostly abandoned by Docker. There hasn't been any new commits for almost 6 months, there are a large number of issues and pull requests that appear to be languishing, and the code owners seem to have sparse activity on GitHub.

Anyone know what gives? Is Docker abandoning the Python library since docker compose is being refactored into GoLang?


Getting started with Python - programming in Python 3.


I built an all-in-one Python Web and AI/ML Resources Website

Hey there,

I just built a Python Resources Website. Divided into two main Pages (Web Backend and AI/Machine Learning) for these Resources, the goal is to simplify the search for some of the best React resources such as:

**1) For Python/Backend:**

• Django, Flask, FastAPI Articles

• Django, Flask, FastAPI Forums latest Discussions (Reddit)

• Django, Flask, FastAPI YouTube Channels Videos

• Django, Flask, FastAPI Websites

• Django, Flask, FastAPI E-books, Snippets

• *Job Opportunities (soon)*

&#x200B;

**2) For Python/AI/ML:**

• AI/ML Articles

• AI/ML Forums latest Discussions (Reddit)

• AI/ML YouTube Channels Videos

• AI/ML Websites

• AI/ML E-books, Snippets

• *Job Opportunities (soon)*

&#x200B;

**Here is the Link 👉** [**helloPython**](https://hellopython.vercel.app/)

&#x200B;

Feel free to give some feedback, I'd like to keep pon working on this project because I love the Python Industry ;)

Thank You!


Send me suggestions

Hello, I am 18 and I have started to code last year. I want to check my code (if it is good or not, send me suggestions ;) ) with this example of the ticktacktoe game in the terminal.

Available here : [https://github.com/FortisCodis/PyTicTacToe](https://github.com/FortisCodis/PyTicTacToe)

Sorry for my bad english I am french...

Thanks


Build a simple bank management system in python with MySQL


Video Introduction to pandas Library in Python


Documentation is highly valued, but often overlooked

Hi all, In 2017, Github (opensourcesurveyorg) conducted a survey on open source projects, and we believe that in 2022, some issues are still relevant.

&#x200B;

https://preview.redd.it/p3nop6uhq4s81.png?width=914&format=png&auto=webp&s=6093f8b9dd8d814002c2b01bff334ecc55f85758

It shows the importance of documentation in an Open source project and how frustrating it can be if it’s not a priority. Some important things, in my opinion:

1. When you encounter documentation problems, help a maintainer and open a change request to improve them.
2. Licenses are by far the most important type of documentation for users and contributors.
3. Documentation helps build engaged communities.
4. When communicating about a project, use language that is clear and accessible to people who are not born English or do not read English fluently.

I work for an open-source project; please feel free to comment if you have any tips for improving documentation.


Maze Creator

I created a website to create and play with mazes.

Website Link: https://desolate-mountain-91027.herokuapp.com/home/

GitHub Link: https://github.com/ShouvikGhosh2048/MazeCreator

I would like feedback on the website and code.


Add machine learning to your apps easily with Google's MediaPipe and Python (Beginner's Guide)

Hey everyone!

**I just released** [**this beginner's guide**](https://www.assemblyai.com/blog/mediapipe-for-dummies/) **to using MediaPipe in Python**. MediaPipe provides really easy-to-use APIs for common ML tasks like hand recognition, face tracking, object detection, and more! You can use it to add ML to apps for things like sign language recognition!

Here's a video of how it performs extracting 3D pose data from a video:

&#x200B;

https://reddit.com/link/tyftwn/video/w02ochs5n4s81/player

Let me know what you think!


Friends and I are tired of online tutorials so we’re running a cohort for learning Python with competitive team games

Hi, we’re a group of 4 friends who are working on something we think is cool but want to hear what you think! We’re super early in working on this - if you want this to exist, register interest on [https://delta-academy.xyz](https://delta-academy.xyz/) :)

The best experiences we had when learning Python were working on projects and hackathons. We also benefited from being in cohorts of learners (e.g. at University) - the friends we made have often lasted.

We want to combine these two elements - live competitive coding games with a cohort of fellow Python learners. The cohort will be \~20 people. It’s the format we wanted but couldn’t find online - so we’re creating it!

We would have to charge for running cohorts (not least to cover the prizes!), but haven’t figured out how much yet - just want to know first if this is something anyone wants!

We made a short video that hopefully explains everything in 1 min.

https://reddit.com/link/tye97u/video/hbsy8qs594s81/player

Really keen to hear feedback. :)


Palmette JS | Python and other language template generator.

Hi everyone,

I recently made this CLI app that can generate a lot of templates (many in python) of different programming  language. Can I ask for a review? Is this a good idea or nah?

(You can install it with "npm install -g palmette-js")

[https://github.com/PalmetteJS/Palmette-js](https://github.com/PalmetteJS/Palmette-js)


Making a face-controlled keyboard (Python OpenCV + MediaPipe)


Rtree 1.0 released


How to summarize text with Python and machine learning

Summarization is a very common task that many developers would like to  automate. For example wouldn't it be nice to automatically create a  summary of each blog article you're writing? Or automatically summarize  documents for your employees? Tons of good applications exist.

In this article I'm showing how easy it is to perform advanced text summarization in Python thanks to Transformers and Bart Large CNN:

[https://nlpcloud.io/how-to-summarize-text-with-python-and-machine-learning.html](https://nlpcloud.io/how-to-summarize-text-with-python-and-machine-learning.html?utm_source=reddit&utm_campaign=la5u8885-fd8e-21eb-ca80-5242ac13d5ja)

Please don't hesitate to ask questions if you have any!


extreqs: parsing package extras from a requirements.txt

I found myself writing the same logic in a couple of `setup.py` scripts so wrote a package to do it: https://pypi.org/project/extreqs/

Broadly, it parses your `extras_require` dict from your `requirements.txt` file using special comments rather than having to define the same thing twice.

As noted in the documentation, there are situations where you wouldn't want to use this, most commonly for libraries. requirements.txt and package dependencies have different purposes in that case: requirements.txt provides a full, (somewhat) reproducible environment for CI and other developers to get an environment with hard versions and all of your linters etc., where package dependencies provide a minimal, permissive environment to allow as many people to use your library as possible. extreqs is primarily designed for applications (web backends, CLIs etc) which have optional extra functionality.

(N.B. not a beginner but it's not a complicated enough codebase to merit anything else...)


GitHub - corpnewt/ProperTree: Cross platform GUI plist editor written in python.


How To Learn Python


I made a game from scratch in 48 hours for the Ludum Dare with Python

I made all of the code, artwork, sfx, etc. solo during the 48 hours of the Ludum Dare as required by the rules.

https://i.redd.it/acex0iv0y1s81.gif

The game (and its source) are available here:

[https://dafluffypotato.itch.io/explont](https://dafluffypotato.itch.io/explont)

I also [livestreamed almost all of the development](https://www.youtube.com/playlist?list=PLX5fBCkxJmm1is3hgaBi037MEGFjtHJex) and created a [timelapse](https://youtu.be/4cgjYlH2g9g).

&#x200B;

https://preview.redd.it/eat9owgny1s81.png?width=631&format=png&auto=webp&s=5cae8fd8386d01c91135a834685bbaeecb97413a


Dockersh : A shell for docker commands with autocomplete

Hi everyone,

I was learning Docker and felt that it was hard to remember all the commands and various arguments. I also kept forgetting the names of my containers & images so I decided to build a CLI for Docker using Prompt Toolkit. Hopefully it will be useful for those of you learning & working with devops. Let me know how I can improve.

The project can be found at [https://github.com/solamarpreet/dockersh](https://github.com/solamarpreet/dockersh)


Continuous feedback and the 'definition of done'

Hey! I wrote a post about what I see is sometimes the short fallings of 'definition of done'. Wonder whether you guys agree with it and have been dealing with such issues?

[https://betterprogramming.pub/youre-never-done-by-definition-c04ac77c616b](https://betterprogramming.pub/youre-never-done-by-definition-c04ac77c616b)


What is the best Python -> direct executable package / compiler today? (April,2022)

I need to create a few applications that I want to distribute as executables, the options I'm aware of are:

Nuitka

pyinstaller

py2exe

py2app

What else is out there, and what is the BEST?

I'm looking to create a couple of cli's using click, and a couple of GUI's using DearPyGui


Pong game in just 14 lines.

    import pygame
    pygame.init()
    win = pygame.display.set_mode((800, 600))
    clock = pygame.time.Clock()
    rects = [pygame.Rect(0, 0, 20, 60), pygame.Rect(780, 0, 20, 60), pygame.Rect(390, 290, 20, 20)]
    ball_vel = [5, 5]
    while clock.tick(60) and not pygame.QUIT in [event.type for event in pygame.event.get()]:
        keys = pygame.key.get_pressed()
        rects = rects[0].move(0, (keys[pygame.K_s] - keys[pygame.K_w]) * 5).clamp(win.get_rect()), rects[1].move(0, (keys[pygame.K_DOWN] - keys[pygame.K_UP]) * 5).clamp(win.get_rect()), rects[2].move(*ball_vel)
        rects[2].topleft = (390, 290) if rects[2].x < 0 or rects[2].right > 800 else rects[2].topleft
        ball_vel[1], ball_vel[0] = -ball_vel[1] if rects[2].y < 0 or rects[2].bottom > 600 else ball_vel[1], -ball_vel[0] if rects[2].collidelist(rects[:-1]) != -1 else ball_vel[0]
        win.fill((0, 0, 0))
        [[pygame.draw.rect, pygame.draw.ellipse][1 if rect == rects[2] else 0](win, (255, 255, 255), rect) for rect in rects]
        pygame.display.update()


Thursday Daily Thread: Python Careers, Courses, and Furthering Education!

Discussion of using Python in a professional environment, getting jobs in Python as well as ask questions about courses to further your python education!

**This thread is not for recruitment, please see** r/PythonJobs **or the thread in the sidebar for that.**


I made the game Wordle in Python

This game is somewhat similar to hangman.

You try to guess a random 5 letter word and the game will tell you the if the placement of each letter is correct or not. Example:

```
O - correct place
? - right letter, wrong place
X - letter is present in word

Word we're looking for: hello
Your word (input): house

Output: O?XX?
```
This continues until you guess the word or give up.

You can look at the code here: [https://github.com/Nextross/Wordle-python](https://github.com/Nextross/Wordle-python)

Any feedback is welcomed!


The last Python 3.11 alpha (3.11.0a7) is available


Continuous Feedback over code

Hey everyone! We made something! I wanted to get your feedback on our new open-source platform - Digma. Digma provides observability 🔭 over code and makes it relevant to feature development.  It gleans code-relevant insights from OpenTelemetry and other sources and provides in-code feedback 💻.  [https://github.com/digma-ai/digma](https://github.com/digma-ai/digma) Python is our first supported language. I'm the author of Digma and am really keen to hear your thoughts!


Blog API built with FastAPI, MySQL, SQLAlchemy, and Alembic


A practical introduction solving differential equations numerically


Configpile: a modern, typed argparse replacement

I started documenting astronomy code written by a PhD student, and wanted a command-line parsing library that would be self documenting.

Thus [ConfigPile](https://denisrosset.github.io/configpile/) was born! It's based on dataclasses with annotated types.

Sample code (imports omitted):

    @dataclass(frozen=True)
    class Calc(Config):
        """
        A simple calculator
        """

        #: First number to add
        x: Annotated[float, Param.store(parsers.float_parser, short_flag_name="-x")]

        #: Second number to add
        y: Annotated[float, Param.store(parsers.float_parser, short_flag_name="-y")]

    c = Calc.from_command_line_()
    print(f"{c.x} + {c.y} = {c.x+c.y}")

Running this with "-h", you can a nice usage help automatically generated (through a legacy ArgumentParser). The same can feed the [sphinx-argparse](https://sphinx-argparse.readthedocs.io/en/latest/) extension to include documentation in the project web pages.

Configpile is based on modern Python, is written in mostly functional style, has user-friendly error reporting which accumulates errors instead of bailing out immediately, supports environment variables and INI files.

I'd be super grateful for comments, especially about the documentation and the Python style.

Follow a tutorial here: https://denisrosset.github.io/configpile/tutorial/index.html

Learn about the main concepts here: https://denisrosset.github.io/configpile/concepts/index.html

The package can be easily installed using `pip install configpile`

(Note: many edits for formatting)


Show the songs that you are listening to on Telegram. (Like Discord's "Listening to") [Recently updated]


UNPHAT method for designing apps

I found this to be very useful when thinking about the most important part of writing apps: understanding what to solve and how. It's from https://news.ycombinator.com/item?id=30931831.

Next time you find yourself Googling some cool new technology to (re)build your architecture around, I urge you to stop and follow UNPHAT instead:

Don’t even start considering solutions until you Understand the problem. Your goal should be to “solve” the problem mostly within the problem domain, not the solution domain.

eNumerate multiple candidate solutions. Don’t just start prodding at your favorite!

Consider a candidate solution, then read the Paper if there is one.

Determine the Historical context in which the candidate solution was designed or developed.

Weigh Advantages against disadvantages. Determine what was de-prioritized to achieve what was prioritized.

Think! Soberly and humbly ponder how well this solution fits your problem. What fact would need to be different for you to change your mind? For instance, how much smaller would the data need to be before you’d elect not to use Hadoop?


I made a small tool to apply "color palette restriction" on images !

I got inspired by /r/place and I wanted to exercice my python skills so I tried to make a tool to redraw images with a specific color palette (/r/place color palette)

Here are some examples :

[Reference image](https://preview.redd.it/3p4us69n7xr81.jpg?width=494&format=pjpg&auto=webp&s=0535c1eed010716f053549eec31a88d4453f2f6e)

[Color palette restriction without dithering](https://preview.redd.it/63df44kt7xr81.png?width=494&format=png&auto=webp&s=341497026bb4dd39dc63718cf792ba1e1f3030ef)

[Color palette restriction with  Floyd-Steinberg dithering](https://preview.redd.it/xccpwquw7xr81.png?width=494&format=png&auto=webp&s=8156a2f09de8b2a58c92f72ef90a5b017a1df2a7)

It can also work with any color palette provided !

Also, I am using PIL to read and draw on images.

&#x200B;

You can find the source code here :  [https://github.com/nrbt25/image-dithering/tree/master](https://github.com/nrbt25/image-dithering/tree/master)


YAML: The Missing Battery in Python


Programming projects for Physics in Python

So I am looking for some projects to do in Physics using Python ,when I searched for the same in Quora ,it was too hard to even comprehend .

I am ready to do some reading if it is needed ,I don't like learning Python just through some courses ,I think that learning by creating projects will be a good motivation.

I have knowledge of Calc 1,2,3 a bit of Linear Algebra ,basics of solving diff equations .

I am taking Classical Mechancis and Electromagnetism .

Any suggestion ,I am aiming to score an internship with this project .

Thank you for reading my post .

Have a nice day


hello this could be an english vocabulary question, what does comprehension mean from 'List Comprehension'? I already learned that is like set builder notation


Scrape Naver Related Search Results with Python

Full DIY code:

```python
import requests, json
from parsel import Selector  # https://parsel.readthedocs.io/

# https://docs.python-requests.org/en/master/user/quickstart/#passing-parameters-in-urls
params = {
    "query": "minecraft",  # search query
    "where": "web"         # web results. works with nexearch as well
}

# https://docs.python-requests.org/en/master/user/quickstart/#custom-headers
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36",
}

html = requests.get("https://search.naver.com/search.naver", params=params, headers=headers, timeout=30)
selector = Selector(html.text)

related_results = []

# https://www.programiz.com/python-programming/methods/built-in/enumerate
for index, related_result in enumerate(selector.css(".related_srch .keyword"), start=1):
    keyword = related_result.css(".tit::text").get().strip()
    link = f'https://search.naver.com/search.naver{related_result.css("a::attr(href)").get()}'

    related_results.append({
        "position": index,    # 1,2,3..
        "title": keyword,
        "link": link
    })

print(json.dumps(related_results, indent=2, ensure_ascii=False))
```

Outputs:

```json
[
  {
    "position": 1,
    "title": "마인크래프트",
    "link": "https://search.naver.com/search.naver?where=nexearch&query=%EB%A7%88%EC%9D%B8%ED%81%AC%EB%9E%98%ED%94%84%ED%8A%B8&ie=utf8&sm=tab_she&qdt=0"
  },
  {
    "position": 2,
    "title": "minecraft 뜻",
    "link": "https://search.naver.com/search.naver?where=nexearch&query=minecraft+%EB%9C%BB&ie=utf8&sm=tab_she&qdt=0"
  },
  {
    "position": 3,
    "title": "craft",
    "link": "https://search.naver.com/search.naver?where=nexearch&query=craft&ie=utf8&sm=tab_she&qdt=0"
  },
  {
    "position": 4,
    "title": "mine",
    "link": "https://search.naver.com/search.naver?where=nexearch&query=mine&ie=utf8&sm=tab_she&qdt=0"
  },
  {
    "position": 5,
    "title": "mojang",
    "link": "https://search.naver.com/search.naver?where=nexearch&query=mojang&ie=utf8&sm=tab_she&qdt=0"
  }
]
```

Alternative solution using [Naver Related results API](https://serpapi.com/naver-related-results) from SerpApi:

```python
from serpapi import NaverSearch
import os, json

params = {
    # https://docs.python.org/3/library/os.html#os.getenv
    "api_key": os.getenv("API_KEY"),  # your serpapi api key
    "engine": "naver",                # search engine to parse results from
    "query": "minecraft",             # search query
    "where": "web"                    # web results
}

search = NaverSearch(params)          # where data extraction happens
results = search.get_dict()           # JSON -> Python dictionary

related_results = []

# iterate over "related_results" and extract position, title and link
for related_result in results["related_results"]:
    related_results.append({
        "position": related_result["position"],
        "title": related_result["title"],
        "link": related_result["link"]
    })

print(json.dumps(related_results, indent=2, ensure_ascii=False))
```

Outputs:

```json
[
  {
    "position": 1,
    "title": "마인크래프트",
    "link": "https://search.naver.com?where=nexearch&query=%EB%A7%88%EC%9D%B8%ED%81%AC%EB%9E%98%ED%94%84%ED%8A%B8&ie=utf8&sm=tab_she&qdt=0"
  },
  {
    "position": 2,
    "title": "minecraft 뜻",
    "link": "https://search.naver.com?where=nexearch&query=minecraft+%EB%9C%BB&ie=utf8&sm=tab_she&qdt=0"
  },
  {
    "position": 3,
    "title": "craft",
    "link": "https://search.naver.com?where=nexearch&query=craft&ie=utf8&sm=tab_she&qdt=0"
  },
  {
    "position": 4,
    "title": "mine",
    "link": "https://search.naver.com?where=nexearch&query=mine&ie=utf8&sm=tab_she&qdt=0"
  },
  {
    "position": 5,
    "title": "mojang",
    "link": "https://search.naver.com?where=nexearch&query=mojang&ie=utf8&sm=tab_she&qdt=0"
  }
]
```

The difference between DIY and API solution is that you don't need to create the parser from scratch, maintain it, or figure out how to bypass blocks from Naver.

Full blog post: https://serpapi.com/blog/scrape-naver-related-search-results-with-python/


Extending pylint with plugins


A Practical Introduction To Web Scraping With Python


Python email sender

 Hi everyone, I have created a script that sends an email to whoever I want using data retrieved from an API (I chose News API, and it will send me the top 20 news of the day).

[https://github.com/jrodriigues/news-email-sender](https://github.com/jrodriigues/news-email-sender)

Take a look, let me know what you think, and how to improve it!


I made my first ever programming assignment into a youtube tutorial


Termtyper - Typing in terminal is fun !

Termtyper is a TUI (Text User Interface) typing application that provides you a great feel with typing with a lot of options to tweak!

It is highly inspired by [monkeytype](https://monkeytype.com/)

It is built on top of [textual](https://github.com/Textualize/textual) which provides the UI for the application

github: [https://github.com/kraanzu/termtyper](https://github.com/kraanzu/termtyper)

&#x200B;

https://reddit.com/link/txbsdd/video/ojo8k2o3mtr81/player


Wednesday Daily Thread: Beginner questions

New to Python and have questions? Use this thread to ask anything about Python, there are no bad questions!

This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at [https://discord.gg/python](https://discord.gg/python) where you stand a better chance of receiving a response.


Why and how to use conda?

I'm a data scientist and my main is python. I use quite a lot of libraries picked from github. However, every time I see in the readme that installation should be done with conda, I know I'm in for a bad time. Never works for me.

Even installing conda is stupid. I'm sure there is a reason why there is no "apt install conda"...

Why use conda? In which situation is it the best option? Anyone can help me see the light?


Online coding video tutorials - Opinions

Hello everyone,

I am currently creating some space science + Python [YouTube tutorials](https://youtube.com/c/Astroniz). In these videos I do some coding and provide some explanations on what I am doing, the science behind it etc.

Now I was wondering whether this is a good approach at all. I really like creating some content on YouTube (no I am not a professional one with my few 100 subscribers), and I am eager to improve it steadily. However I thought that "live coding" may take too much time and isn't easy to follow. My idea is to explain e.g., science related Jupyter Notebook cells in the videos to shorten the length. The code is provided on GitHub anyway, so a viewer could follow my tutorial (and thoughts) more easily. The coding would be reduced to a minimum and the focus could move to the "non coding" part.

Any ideas or comments would be appreciated!

Thomas


Rubik's Cube Model in Python using OOP

I've been thinking for a while about developing a model to simulate a Rubik's cube in Python. I wanted to make use of object-oriented programming, and this project was the perfect excuse to get down to work. 💻⌨🖖

https://carlosgrande.me/rubiks-cube-model/


What happened between SciPy creater Travis Oliphant and Enthought?

I was listening to his interview on the [Lex Friedman podcast](https://open.spotify.com/episode/2U2AkSSuAzmZi7nmGzJboW?si=28e8c7d915e04f75) and he mentioned that he is no longer friends with the founder of Enthought because he started Anaconda. I can't find any details online, does anyone know the story?


My first package to pypi. Connpy: Network connection manager and automation module

Hi!

So a little bit of background, I'm a network engineer (ccie), with 10+ years of experience in networking, and i'm a really lazy guy so usually i try to automate and script everything. long time ago i created my bash connection manager and been using it since. A month ago i decided it was time to upgrade it to python and add the automation function i always wanted, and that is how connpy was born.

I'm not a programmer so it may have some issues! let me know.

[https://github.com/fluzzi/connpy/](https://github.com/fluzzi/connpy/) <- here is the link, it also have some documentation it should be easy to use. It's created for linux as it's what i use everyday but i did some testing on macos and it should work.

## connection manager

First its the connection manager, it adds the commands conn/connpy to shell, and you can add all the devices you manage easily:

- conn --add server1

you can add folders and subfolders to organize your devices. i use to work with a lot of clients so i have like 400+ nodes divided in multiples folders.

- conn --add "@office"
- conn --add "@servers@office"
- conn --add server2@servers@office
- conn --add server3@servers@office
- conn --add router1@office

when you are creating a new node to connect, it allows you to refer profiles, this way you can manage passwords and other information in 1 place and use it in multiple nodes.

- conn profile --add officeuser

then you reference inside the node configuration using "@officeuser".

you can use profiles to send multiple passwords in case you use 1 or more jumphosts.

Once the nodes are created you just connect to them without passwords.
- conn server1
- conn server2@servers@home
- conn server

## automation module

this is the new feature, once you created your nodes you can use them with the automation module

- import connpy
- config = connpy.configfile()
- server1 = config.getitem("server1@office")
- router1 = config.getitem("router@office")
- server = connpy.node("server1",**server1,config = config)
- router = connpy.node("router1",**router1,config = config)
- print(router.run(["term len 0", "show run"]))
- if server.test("ls -la", "folder to find"):
-   print("folder found")
- else:
-   print("missing folder")

You can also run in multiple devices at the same time using class nodes. (more in the documentation)

Hope someone find it useful!!
thanks!


"Bicycle or Metro": My first interactive web app using Dash/Flask.

I collected data from the Google Direction API and built an interactive app comparing travel duration times between Bicycle and Public Transportation in Santiago, Chile.

Each specific route to a point in the map can be accessed by clicking on the destination point, and the relevant information will be displayed.

The app is deployed on Heroku (forgive the slow response): [http://biciometro.herokuapp.com](http://biciometro.herokuapp.com) . The website is in Spanish, but its features should be easy to understand.

**Tools:**

* For the GeoJSON grid, I used this [grid creator](https://cityofaustin.github.io/geojson-grid/#). I used Pandas, Dash, Plotly, NumPy and Mapbox. Everything is coded in Python.
* Source code for the app: [https://github.com/mirkosimunovic/biciometro](https://github.com/mirkosimunovic/biciometro)
* Please show support with a Github star   if you like the project. Thank you!


Create a timelapse of any canvas area and any timeframe of r/place

[(Github) Source code and download](https://github.com/gislerro/rplace-cropped-timelapse-creator)

Configuration in the config.yaml file:

* range of images to create timelapse for [(archive of snapshots here)](https://rplace.space/combined/)
* granularity of frames (take every n-th image - determines speed of timelapse)
* top-left coordinates of the canvas timelapse
* width & height of the canvas
* mp4 output dimensions & name

&#x200B;

[Example](https://reddit.com/link/tx3x67/video/vgytvsfpprr81/player)


Applications of Python

Hey! Anyone who is interested in learning about the applications of python in the field of automation should check out [this](https://medium.com/@Nick_27/automation-using-python-66ec75a6b0ba) article.

It really encourages you to learn more about the language!


Learning Python

Python just makes so much freaking sense! LOVING IT!!


Running a live 45-minutes session on the fundamentals of observability, OpenTelemetry, and distributed tracing with microservices messaging systems (Kafka, RabbitMQ, etc)

Hi everyone, we're running another live OpenTelemetry and observability fundamentals session -  Wednesday, April 20 at 11 AM PDT.

You will learn how to instrument your message brokers and apps to capture traces with OpenTelemetry.

This session is at no cost and vendor-neutral.

You can expect in this session: 45 minutes of core concepts, how to deploy it yourself hands-on + Q&A.

If you are interested in observability, OpenTelemetry, and tracing - join!

Register here [https://www.aspecto.io/opentelemetry-fundamentals/messaging-systems/](https://www.aspecto.io/opentelemetry-fundamentals/messaging-systems/?utm_source=post&utm_medium=reddit&utm_campaign=r-python-opentelemetry-fundamentals-messaging-systems)


As of today, how well does Anaconda run on M1 MacBook Pro?

Last year, there was an article from the developer that they were working on M1 version of the software suite. However, I don't seem to hear any news after that. Are they still working on it? I recall there were some compatibility issues with some packages last year. How well does it run on M1 MacBook Pro as of today? Are Anaconda and its packages fully compatible with M1 Mac now?


Attending my first PyCon US 2022 (SLC) - tips?

What recommendations would you have for someone new to this conference?

I am new to programming and a beginner learning python (self-taught). Hoping to network, learn about new ideas to get my excited, and do some running in a new place.


Reason to go from Python3.9 to 3.10 ?

I don't find and real advantages and all i have to do works fine on 3.9.

Change my mind.


I'm presenting live in 6 hours at Microsoft Reactor online about troubleshooting Python applications, especially on Kubernetes. (Part 2 of the Python on Kubernetes series.) Let me know your questions in advance


Python Firebird-driver 1.4.3 released


How to Execute SQL Queries in Python and R Tutorial


Community for Python app developers

Hey, I'm curious if there is a dedicated community of Python developers who are making apps with frontend interface. (As opposed to data analysis or training ML models).

For example, developers who are using Streamlit or Anvil. (Are there any other big ones?)

Do you know any such communities?


Python and the Truth

Hi folks,

Excited to share some notes on Python's Truth values, their internals, and possible applications.

[https://towardsdatascience.com/python-and-the-truth-90cf08380246](https://towardsdatascience.com/python-and-the-truth-90cf08380246)

Thanks and happy reading!


Why is Python becoming indispensable in IoT Industry?

IoT Applications are usually pre-built SaaS (software-as-a-service)  applications. These can present and analyze captured IoT sensor data to  businesses via dashboards. They use machine learning algorithms and  analyze huge amounts of connected sensor data in the cloud. Real-time  IoT alerts and dashboards provide you visibility into key performance  indicators, statistics for the meantime between failures, and other  details.


I got a little problem with my visualization program.

I find a great code of visualizing the PSO algorithm in 2D. And I tried to change it into 3D.I've done the majority part of it, but now the particles just don't update, they superpose over the old ones.

[Figure shows like this](https://preview.redd.it/fhiagfvecnr81.png?width=1102&format=png&auto=webp&s=6ed3c223f26d9407aecc242b2facc2e23458e16f)

&#x200B;

Here is the code link：

[https://linkode.org/#LsQHmirehTrbP1pqXEI2Q5](https://linkode.org/#LsQHmirehTrbP1pqXEI2Q5)


Visualize Differential Equations

[https://www.youtube.com/watch?v=gH47pQHeKDE](https://www.youtube.com/watch?v=gH47pQHeKDE)

Normalize for your highest order derivative and plug in your initial conditions to numerically solve any differential equation


Use nested GitHub Action Runners to reduce costs by up to 50% for multiple jobs in one workflow


Tuesday Daily Thread: Advanced questions

Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.

**If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.**

This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at [https://discord.gg/python](https://discord.gg/python) where you stand a better chance of receiving a response.


Predicting the Champions League with Python! (21/22)


I published my first tutorial on YouTube: Insertion sort explained + Python code


I made use of Zoho Sheets and used it as a database engine

I started working on this yesterday and have just finished rewriting it into classes and publishing it as a PyPI project :)

This module uses Zoho Sheets (which is completely free to use) as a way to store data.
I'm keen on the development of ZohoDB.py and aiming to keep improving it's performance in order to make it a kinda production-ready module :)

Would love to hear your feedback on this one
https://github.com/oddmario/zohodb.py


Create python logo on r/place

I in the r/place we can create a python logo on 384,1618


Voice Controlled Switch Using Arduino & Python


Python f-strings Are More Powerful Than You Might Think


Book for python network programming

Hey folks, can you please recommend a good book(s) for network programming? Something that would cover subjects from low level TCP/IP, to SMTP/SSH/HTTP/etc libraries? Thanks in advance!


Head-first Kubernetes - A hands-on tutorial for beginners


Active Learning in Machine Learning Explained


Can my IT department tell (without any sortve deep dive) that I'm using a python script to login?

I have to do timesheets for my crew every morning, and it takes about twenty minutes a day. I've long since thought I could automate this, and write a little proof of concept and it worked.

It would however involve using pyautogui to enter my login information including password into our time management software. Do you think this could get me into shit with the IT department?


StackSocial Discount. Are their courses any good?

I saw that they were offering a 'complete Python certification bundle' for $35 'reduced from $2k' if you can believe that.

I'm beginner to intermediate - written some Flask websites and programmed some automated stuff, so I was wondering if anyone would recommend this sort of thing to get into Python programming professionally?


Rock, Paper, Scissors

LMK what I can do differently. Thanks!

&#x200B;

running = True
while running:
 player1 = input(" (Player1) Rock, Paper, or Scissors:\\n >")
 player2 = input(" (Player 2) Rock, Paper, or Scissors:\\n >")

 if player1.lower() == "rock" and player2.lower() == "scissors":
 print("Player 1 Wins!")
 if player2.lower() == "rock" and player1.lower() == "scissors":
 print("Player 1 Wins!")
 if player1.lower() == "paper" and player2.lower() == "scissors":
 print("Player 2 Wins!")
 if player2.lower() == "paper" and player1.lower() == "scissors":
 print("Player 1 Wins!")
 if player1.lower() == "rock" and player2.lower() == "paper":
 print("Player 2 Wins")
 if player2.lower() == "rock" and player1.lower() == "paper":
 print("Player 1 Wins")
 playing = input("Do you want to keep playing? y/n \\n > ")
 if playing.lower() == "n":
 break
 if playing.lower() == "y":
 running = True


Solving and Animating the 3D Double Pendulum in Python: Sympy for algebra, Scipy for numerically solving differential equations, and vpython for 3D animation


ConfigParser - manage user-editable settings for your Python programs


Scraping Naver Videos in Python

Full code:

```python
import requests, os, json
from parsel import Selector

def parsel_scrape_naver_videos():
    params = {
        "query": "minecraft",  # search query
        "where": "video"       # video results
    }

    headers = {
        "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36",
    }

    html = requests.get("https://search.naver.com/search.naver", params=params, headers=headers, timeout=30)
    selector = Selector(html.text)  # very similar to bs4, except parsel supports Xpath

    video_results = []

    for video in selector.css(".video_bx"):
        # https://parsel.readthedocs.io/en/latest/usage.html#using-selectors
        title = video.css(".text::text").get()
        link = video.css(".info_title::attr(href)").get()
        thumbnail = video.css(".thumb_area img::attr(src)").get()
        channel = video.css(".channel::text").get()
        origin = video.css(".origin::text").get()
        video_duration = video.css(".time::text").get()
        views = video.css(".desc_group .desc:nth-child(1)::text").get()
        date_published = video.css(".desc_group .desc:nth-child(2)::text").get()

        video_results.append({
            "title": title,
            "link": link,
            "thumbnail": thumbnail,
            "channel": channel,
            "origin": origin,
            "video_duration": video_duration,
            "views": views,
            "date_published": date_published
        })

    print(json.dumps(video_results, indent=2, ensure_ascii=False))
```

Part of the output:

```json
[
  {
    "title": " : 🌲 How to build Survival Wooden Base (#3)",
    "link": "https://www.youtube.com/watch?v=n6crYM0D4DI",
    "thumbnail": "https://search.pstatic.net/common/?src=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fn6crYM0D4DI%2Fmqdefault.jpg&type=ac612_350",
    "channel": "소피 Sopypie",
    "origin": "Youtube",
    "video_duration": "24:06",
    "views": "671",
    "date_published": "4일 전"
  },
  {
    "title": "마인크래프트 무한순환 이론 (",
    "link": "https://www.youtube.com/watch?v=kQ7wyG9mShQ",
    "thumbnail": "https://search.pstatic.net/common/?src=https%3A%2F%2Fi.ytimg.com%2Fvi%2FkQ7wyG9mShQ%2Fmqdefault.jpg&type=ac612_350",
    "channel": "TV블루위키",
    "origin": "Youtube",
    "video_duration": "01:44",
    "views": "9만",
    "date_published": "2022.02.15."
  } ... other results
]
```

Blog post link if you need code explanation: https://serpapi.com/blog/scrape-naver-video-results-with-python/


Creating A Modern Python Development Environment


Different types of implementation of polymorphism

Hi All,

I am reading about OOP in python and wonder if we implement ` __add__`, `__sub__` etc, it looks to me thst we are doing operator overloding. So my question is, that is it correct to think like that and does this implementation falls under AdHoc polymorphism in python.

Thanks
Pradeep


CaptchaCracker - Deep Learning-based Captcha Recognizer

Hello!

I made a python open source project.

**Github Repository:** [https://github.com/WooilJeong/CaptchaCracker](https://github.com/WooilJeong/CaptchaCracker)

# CaptchaCracker

## Introduction

CaptchaCracker is an open source Python library that provides functions to create and apply deep learning models for Captcha Image recognition. You can create a deep learning model that recognizes numbers in the Captcha Image as shown below and outputs a string of numbers, or you can try the model yourself.

## Input

https://preview.redd.it/qltiatrqxgr81.png?width=250&format=png&auto=webp&s=8e4d370203ff502b4681c8b35a8fee1cff7fd259

## Output

    023062

## Installation

    pip install CaptchaCracker

## Dependency

    pip install numpy==1.19.5 tensorflow==2.5.0

## Examples

## Train and save the model

Before executing model training, training data image files in which the actual value of the Captcha image is indicated in the file name should be prepared as shown below.

* [Download Sample Dataset](https://github.com/WooilJeong/CaptchaCracker/raw/main/sample.zip)

https://preview.redd.it/n451dp4sxgr81.png?width=1009&format=png&auto=webp&s=2c0173b4d685f73642edbfd780ae3fdf4d921bdf

    import glob
    from CaptchaCracker import CreateModel

    train_img_path_list = glob.glob("../data/train_numbers_only/*.png")

    CM = CreateModel(train_img_path_list)
    model = CM.train_model(epochs=100)
    model.save_weights("../model/weights.h5")

## Load a saved model to make predictions

    from CaptchaCracker import ApplyModel

    weights_path = "../model/weights.h5"
    AM = ApplyModel(weights_path)

    target_img_path = "../data/target.png"
    pred = AM.predict(target_img_path)
    print(pred)


QualityScaler 1.1.0 - Image/video upscaling & enhancement GUI app based on BRSGAN & RealSR_JPEG

Image/video upscaling GUI app based on BRSGAN & RealSR\_JPEG

[GUI interface](https://preview.redd.it/9rxldsstugr81.png?width=1392&format=png&auto=webp&s=4760f210cb169dc95679b5a5183ed0e142cbbad4)

## Links.

Github -> [https://github.com/Djdefrag/QualityScaler/releases/tag/1.1.0](https://github.com/Djdefrag/QualityScaler/releases/tag/1.1.0)

Itch -> [https://jangystudio.itch.io/qualityscaler](https://jangystudio.itch.io/qualityscaler)

## Credits.

*BSRGAN -* [*https://github.com/cszn/BSRGAN*](https://github.com/cszn/BSRGAN) *|* [*https://arxiv.org/abs/2103.14006*](https://arxiv.org/abs/2103.14006)

*RealSR\_JPEG -* [*https://github.com/jixiaozhong/RealS*](https://github.com/jixiaozhong/RealS)R | [https://arxiv.org/pdf/2005.01996.pdf](https://arxiv.org/pdf/2005.01996.pdf)

## Installation.

QualityScaler is completely portable; just download, unzip and execute the file .exe

## Supported AI Backend.

* Nvidia Cuda \[v10.2\]
* CPU \[works without GPU, but is very slow\]

## Features.

* Easy to use GUI
* Images and video upscale
* Drag&drop files \[image/multiple images/video\]
* Different upscale factors:
   * auto - automatic choose best upscale factor for the GPU used (to avoid running out of VRAM)
   * x1   - will mantain same resolution but will reconstruct the image (ideal for bigger images)
   * x2   - upscale factor 2: 500x500px -> 1000x1000px
   * x4   - upscale factor 4: 500x500px -> 2000x2000px
* Cpu and Gpu \[cuda\] backend
* Compatible images - PNG, JPEG, BMP, WEBP, TIF
* Compatible video  - MP4, WEBM, GIF, MKV, FLV, AVI, MOV

## Next steps.

1. Use both model for the upscale
2. Include audio for upscaled video
3. Support for other GPUs (AMD, Intel) with new backend

## Example.

Original photo (200x200 px)

https://preview.redd.it/3yb1t6nxugr81.png?width=220&format=png&auto=webp&s=b950ff4af4cfcb5e2fe97cece00f9b4c7c3f1698

BSRGAN (800x800 px)

https://preview.redd.it/wghr3c7yugr81.png?width=880&format=png&auto=webp&s=67360909111338bfb01e111e1fab8cdd6c3531e7

RealSR\_JPEG (800x800 px)

https://preview.redd.it/blh6vmlyugr81.png?width=880&format=png&auto=webp&s=68af9f79d102b2c906f8c54bb84fdef44b6db7d2


Machine Learning Sandbox in Python

Hope you are doing well. I was reaching out to share one of my projects with all of you . The idea was to build a sandbox of ML algorithms that people could use to demonstrate classical ML algorithms and also break down the same with simple from-the-scratch implementation in Python. You can simply fork the repo and start running the algorithms. I hope you find it useful. Do let me know your feedback on the same and if I can make any improvements in this.

&#x200B;

Project Link: [https://github.com/devAmoghS/Machine-Learning-with-Python](https://github.com/devAmoghS/Machine-Learning-with-Python)


Is List Comprehension The Most Effective Way to Solve Any Tasks? | Python


Choosing Python over other languages

This is an interesting blog that I read. It's written by Brett Cannon who is a core developer of Python. It essentially explain why you shouldn't automatically ignore Python because it's not as fast as some other programs.

&#x200B;

 [Selecting a programming language can be a form of premature optimization (snarky.ca)](https://snarky.ca/programming-language-selection-is-a-form-of-premature-optimization/)


Open-Source python package to find relevant images for a sentence

&#x200B;

[Search results for \\"a happy potato\\"](https://preview.redd.it/2cnopvno0gr81.jpg?width=744&format=pjpg&auto=webp&s=eecc9e9948c386fbd959289257c347fa19c35644)

You **don't** need to caption the images for the search to work, and it is **not** just limited to objects in the image but an overall understanding built using a neural network trained on images/text found on internet.

This is what [CLIP-as-service](https://github.com/jina-ai/clip-as-service) enables. It is an open-source library to create embeddings of images and text using CLIP. These embeddings can be used to find the relevant images for any sentence.

**What is CLIP?**

CLIP is a Neural Network trained on variety of images and natural language sentences available on the internet. It enables understanding of concepts in an image as natural language. This can be used for cases such as searching image by text or describing an image in natural language.

The demo screenshot shown in the post is an example showing relevant images for a particular query sentence.

More info on Github readme about how to achieve this

* Source code: [https://github.com/jina-ai/clip-as-service](https://github.com/jina-ai/clip-as-service)
* License: Apache 2.0

What would you use it for? And what next features/improvements should I work on?


If you're bored at work or school.

Try to open Python Idle and Import antigravity module

`import antigravity`

Then laugh.


swagger-gen: the Swagger spec generator you've been waiting for

Hey Python people,

As a .NET developer by day, I've always been bummed by the lack of real Swagger spec generators available for Flask compared to Swashbuckle for ASP.NET.  I personally don't want to write some markup or clutter the service with a bunch of code to generate the docs, I wanted something that would generate the spec for you, with no setup required, with optional features to expand the detail of the documentation.

So I built that!  If you like Swagger, you'll like this.  It's a pretty full-featured library, but I'm sure there's room for improvement and welcome any friends that'd like to contribute.

[https://pypi.org/project/swagger-gen/](https://pypi.org/project/swagger-gen/)

[https://github.com/danleonard-nj/swagger-gen](https://github.com/danleonard-nj/swagger-gen)

Thanks for checking it out :)


Is r/Python participating in r/place?


iMandelbrot is a tool made out of PyGame that visualizes the nature of a Mandelbrot fractal!

# Mandelbrot: An Interactive Module

**iMandelbrot** is a **learning aid** purely made out of **PyGame** that visualizes the nature of a **Mandelbrot** fractal!

GitHub Link: [https://github.com/wonmor/iMandelbrot-Plotter](https://github.com/wonmor/iMandelbrot-Plotter)

## Public Release 1.2.0

**DEVELOPED** AND **MAINTAINED** BY **JOHN SEONG** • **MIT** LICENSE

[Download for **Intel-based Macs**](https://github.com/wonmor/iMandelbrot-Plotter/raw/main/installer/iMandelbrot_Mac.dmg) → Make sure to turn on the '**Open Using Rosetta**' option on **M1 Macs**!

## Why Our Product Is Sexier Than Others

For the sake of **optimization**, **iMandelbrot** only generates the coordinates above the x-axis — basically duplicating to the corresponding coordinates below the horizontal line.

&#x200B;

https://preview.redd.it/jr48nb5fper81.png?width=3456&format=png&auto=webp&s=3b116ded17242fd28d1f685145f0d283932eb5a5


Monday Daily Thread: Project ideas!

Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, ["The Big Book of Small Python Projects"](https://inventwithpython.com/bigbookpython/) which provides a list of projects and the code to make them work.


Python libraries for hierarchical or multilevel time series analysis

What are the python libraries best suited for analyzing time series with hierachical or multiple levels like geographic levels between neighborhoods within cities and cities within states.


Python and Blockchains

Why is Python is not used as much in blockchain technology, Specially in the core of blockchains


Two new articles this week: Beginner tutorial on classes and object-oriented programming with exercises and Python careers research

Hi all,

In the last few days, I had a lot of fun publishing two brand new articles for you:

* [Python Classes Zero to Expert: A Tutorial with Exercises](https://codesolid.com/getting-started-with-python-classes/)
For new programmers just beginning with Python and learning about object orientation, this beginner-focused article covers the basics in some detail, with exercises at the end to reinforce what you've learned.

* [Best Python Careers: New Research Reveals Top Fields](https://codesolid.com/career-paths-for-python-programmers/)
Based on my own experience in the industry as well as job board research, I detail how many jobs there are in different areas of Python programming and what sorts of hoops you might need to jump through to break into the field.

Please upvote if you like them, and enjoy!


we need to make the python logo in r/place

Don't you think? Imo it would be so cool if some of us got together and started to plan it :)


Twitter read and analysis

    # Import tweepy to work with the twitter API
    import tweepy as tw

    # Import numpy and pandas to work with dataframes
    import numpy as np
    import pandas as pd

    from matplotlib import pyplot as plt

    consumer_key ='mycode'
    consumer_secret = 'mycode'

    access_token ='mycode'
    access_token_secret = 'mycode'

    # Authenticate
    auth = tw.OAuthHandler(consumer_key, consumer_secret)
    # Set Tokens
    auth.set_access_token(access_token, access_token_secret)
    # Instantiate API
    api = tw.API(auth, wait_on_rate_limit=True)

    hashtag = "#slap"
    query = tw.Cursor(api.search_tweets, q=hashtag).items(1000)
    tweets = [{'Tweet':tweet.text, 'Timestamp':tweet.created_at} for tweet in query]
    print(tweets)

    df = pd.DataFrame.from_dict(tweets)
    df.head()

    willsmith_handle = ['willsmith', 'will smith', 'will', 'smith', 'slap\'s']

    def identify_subject(tweet, refs):
        flag = 0
     for ref in refs:
     if tweet.find(ref) != -1:
                flag = 1
     return flag

    df['will smith'] = df['Tweet'].apply(lambda x: identify_subject(x, willsmith_handle))
    df.head(10)

    df.to_csv('Twitter_feed.csv', encoding='utf-8')

A working process based on an online tutorial. The code takes in twitter tweets and exports them to csv file.

I'm going to try and expand to read the sentiment and feedback of different tweets.


Dice roll Probability

    import random
    import collections
    import time

    ##Outcome	List of Combinations	Total
    ##2	1+1	1
    ##3	1+2, 2+1	2
    ##4	1+3, 2+2, 3+1	3
    ##5	1+4, 2+3, 3+2, 4+1	4
    ##6	1+5, 2+4, 3+3, 4+2, 5+1	5
    ##7	1+6, 2+5, 3+4, 4+3, 5+2, 6+1	6
    ##8	2+6, 3+5, 4+4, 5+3, 6+2	5
    ##9	3+6, 4+5, 5+4, 6+3	4
    ##10	4+6, 5+5, 6+4	3
    ##11	5+6, 6+5	2
    ##12	6+6	1

    #create list
    dice_list=[]

    for i in range(1,7):
        #dice 1
        dice1= i

        for j in range(1,7):
            #dice 2
            dice2= j
            #dice total
            dice_reads=dice1+dice2

            ##add to list
            dice_list.append(dice_reads)

    ##sort list
    dice_list.sort()

    ##dictionary
    probability = {}

    ##Place a Bet
    User_bet = input("Enter a bet between 2 to 12: ")

    ###using collections.Counter for number frequency
    probability=collections.Counter(dice_list)

    # printing the probability
    #print(probability)

    ##percentage method
    def math_percentage(User_bet):
        print("The user bets a "+str(User_bet))
        for dice in probability:
            prob=probability[dice]
            percentage=round(float(((prob)*100)/36))
            #print("The percentage of a "+str(dice) +" is "+str(percentage)+ " %")
            if dice==int(User_bet):
                print("The percentage of a " + str(dice) + " is " + str(percentage) + " %")

                ##Pause
                time.sleep(10)

    ##call method
    math_percentage(User_bet)

    ##100 dice rolls
    for i in range(0,1):
        #dice 1
        dice1= (random.randint(1,6))
        #dice 2
        dice2= (random.randint(1,6))
        #dice total
        dice_reads=dice1+dice2

        print("Dice reads: "+str(dice_reads))


Who exactly is a python developer? I know this is a broad term which include many paths. But do we have to cover them all to become one? much like, one term to rule them all?

Hii all

I've seen the term "Python developer" been around online, and the  roadmap to become one. As we all know, it does include many paths, web dev, analysis, DS, ML and so on. To be called a python dev, do we actually need to cover all potential paths and then just choose one? or we should be able to do anything under this big umbrella term?

My question is coming from my interest in learning python and DS. That's when I started my journey. I am still in process of learning. But I also want to learn some kills related for backend dev via python. For many reasons, first even though my love goes for DS but there's less opportunities and more competition. (as far as I know). So, probably having extra skills can add value or come in handy for model production. Also, I won't mind working as backend dev, as I'll def use DS in research for later future plans.

When I share this with someone, like my interest in DS and web dev. I got the response of these are totally different and I am heading to the wrong direction (well, maybe I am) but I wanted to cover my interest in more of a broader term like "python dev" but there's the fact that some of the  paths under this term I don't have much of interest in.

Should I specify myself as python dev with some specific libraries "Generally speaking". I do understand when it come to job haunting  I should be more specific like looking for DS, analysis...etc.

But let's say I want include sth in my linkedin bio. I don't want to throw analysis, DS, ML, web dev all at once. I was considering python dev and then when it's come to job haunting I can pick and choose.

I hope this is not a weird question :)


python logo in r/place

guys let’s make the python logo
discuss coordinates and such in the comments


I am working on some 3D reconstruction using TOMVIZ, does anybody know any tutorial for segmentation in this software?


Introducing File Folder Hider! (made with Tkinter Python)

I've been working on this project for a couple of months now, first it was in the from of a terminal where the user had to give certain commands to get the job done, but now, its a fully-fledged GUI with buttons and labels to guide you. It has its two main features, "Hide" and "Unhide", which help you hide and unhide any file and/or folder from the File Explorer (more in the readme.txt). Moreover, you can opt in optionally to enter your email address and in case you ever forget the Master Password used to access the program, you can press the "Forgot Password" button to have a recovery code sent to your email and after verifying, you will be allowed to change the current Master Password, or if you happen to remember it again, simply go back to the main menu (because you've already verified yourself through the recovery procedure, it is safe to assume the user is the correct one). One thing to keep in mind is that all the credentials (the Master Password and your email address specifically) are encoded to ensure minimum security. At least that's better than none at all. Another important thing to note is that some command prompt screens will appear when running the program and hiding/unhiding the files/folders. That is a side-effect of trying to have the program run on the user level in order to get around permission issues and not running as admin, so sorry for that.

Links:

File Folder Hider repository: [File Folder Hider on Github](https://github.com/Mubashir78/File_Folder_Hider_with_dialog_box)

My other repositories (basically to my Github profile): [My Profile on Github (Mubashir78)](https://github.com/Mubashir78)

Please feel free to try it out for your daily routine and let me know your guys' feedback in the comments!

[Dialog box for when creating\/changing Master Password. Email is optional as it says](https://preview.redd.it/if9ff53mqcr81.png?width=502&format=png&auto=webp&s=2b074f0ee02eec7f5e5394fe291a6ebf95432a5e)

[Main Menu Dialog Box \(after successfully creating\/entering the Master Password\)](https://preview.redd.it/63y52tj0scr81.png?width=501&format=png&auto=webp&s=75fb030989360f44e6e922927211b199ce5dfefe)

[Dialog box for after creating the Master Password and entering the email and running the program again. Incase of not adding an email, the \\"Forgot Password\\" is grayed out and an \\"?\\" icon shows up which tells you that you haven't added email in order to use the feature when hovering over it](https://preview.redd.it/rkxmbcp7tcr81.png?width=404&format=png&auto=webp&s=2618f24e11794d151e83000f5ceebe04da14e056)


I made a video comparing different data storage formats that python users should consider. Feedback welcome!


Easier Regexps


A Redux inspired store pattern for asyncio applications - SimpleEventMonitor

So, recently I had to deal with the issue of setting up a solution to monitor a few on-prem deployments for health status. The on-prem clusters were configured to send emails with multiple tables with the status of every node etc.

Well, it is a pretty straightforward solution was writing a python script to check the mailbox for new mail and download recent mail from the cluster, parse the mail and for each table entry verify for failed nodes and create an alert ticket of each node. I stumbled upon a [Github Project](https://github.com/wichmannpas/simple-mail-monitoring) that does something like this.

Considering the job was pretty much done, I was able to quickly use that script to do basic email retrieval and write parsers for my mail and get the job done in a few hours.

However,  the code felt very complicated and it was pretty much thrown away, but after giving it a few hours of solace at home, it occurred to me,  this kind of problem could be better tackled with queues or pubsub model and it has been a while I have played around with python.  I wanted to avoid the hassle of setting up Redis/rabbitmq etc, I was rather looking for something like redux for python applications, which I can use to separate out my data producers and consumers.

I had a few things in my mind for this side project :

\- In memory pubsub

\- Use asyncio

\- Be able to schedule events without cron tasks

\- Unobtrusive pattern to design my python code into producer and consumer model

\-  Ability to develop pull-based data sync, which can connect to your real time data feed

Here is the basic hello world program which demonstrates how you can create a publisher function and schedule it with run\_every to execute every 180 seconds after the last execution.

[aioredux hello world](https://preview.redd.it/6vb91s6accr81.png?width=3164&format=png&auto=webp&s=6de8ffdbda5fad9eb22404325887e8873a105c60)

Here is the link to my [fork](https://github.com/aregee/simple-mail-monitoring) of the Simple Mail Monitoring Github project, which utilizes this pattern to run the existing functionality provided by the original source.

I can't share my private repo, but I must say after moving that hackish script to this slightly better hack has made the code so clean and flexible, we have not just accomplished that email report task, but rather we are able to see many more such use cases internally where we can utilize this pattern.

Please feel free to share your thoughts, feedback, or even pull requests on the project.


magic-timer: Conveniently get a rough idea of how long things take. (package)


Darts in higher dimensions

While browsing YouTube, I came across the following video in which a little puzzle is presented that is solved mathematically. Using maths, an answer was presented that I validated by implementing a simulation.

I thought this was a fun little challenge to program. Maybe others want to give it a go as well?
How would you have approached this?

Video: [https://www.youtube.com/watch?v=6\_yU9eJ0NxA](https://www.youtube.com/watch?v=6_yU9eJ0NxA)
My code: [https://gitlab.com/JeroenStiers/scripts/-/blob/main/darts\_in\_higher\_dimensions.py](https://gitlab.com/JeroenStiers/scripts/-/blob/main/darts_in_higher_dimensions.py)


r/Place

Are people interested in putting the 2 snakes in there?


Simple and Super Easy-to-use Colabs

[Github](https://github.com/BreezeWhite/interesting-colabs)

Tired of figuring out how to use a research demo colab? Feeling lost in the arrangements of all the messy colab blocks and information?

I want to share my personal collections of colabs that is definitely easy to use. This is not just another “awesome list” series of repo, with just links to the original resources. All the colabs within this collections are refactored and deliberately simplified by me. And I can promise you that they are all super easy to use, even your 6-year-old child would know how to use.

There are at most three code blocks to be executed!! Minimum steps are required to get directly to the expected final results. Example outputs are also provided to have a quick experience. Everything is just simple and clean, no lengthy and confusing intros, nor chaotic arrangements of blocks.

I will continually update the repo, adding more interesting yet hard to get started projects. Feel free to comment and leave feedbacks below. If you know something is really awesome and interesting, but just no way to figure out how to use, I would be very happy adding to the list and wrapping it!


Instagram bot and Data gathering with GUI

Hi,

InstaMachine is a post-oriented Instagram bot which means it is more focused on gathering data and storing it inside the SQLite database. I made this app solely to put to test my web scraping abilities as a beginner programmer and build up some portfolio, therefore I did not use any python's Instagram library such as instapy.

[https://github.com/theRJorj/Insta-Machine](https://github.com/theRJorj/Insta-Machine)

I would appreciate your feedback on any aspects of this project

[InstaMachine](https://preview.redd.it/8gftzkswibr81.png?width=1500&format=png&auto=webp&s=e5c30426a7429a8c9245914df4c03862d8ac566e)


Python beginners created these games based on my tutorials! What do you think?


Python open-source OpenBB Terminal against Bloomberg Terminal


How is PyPy Tested?


PtPython as default Django shell - my first Django package

Hey there!

I've built a package to use PtPython as default Django shell.

Due to extra functionalities of PtPython, I'm using that rather than Python and maybe many of you using ptpython too  so I tried to make it default shell in Django framework.

You can give it a try:

`pip install django-ptpython`

Github repository: [https://github.com/reganto/django-ptpython/](https://github.com/reganto/django-ptpython/)

PyPi: [https://pypi.org/project/django-ptpython/](https://pypi.org/project/django-ptpython/)

&#x200B;

I'd like to get your feedbacks.

Thank you.


Python dictionary implementation


Share Python Code Snippets Like A Pro Without Using GitHub


Python Selenium Tutorial #7 - Save & Reuse Cookies


What Lies Between the Fibonacci Numbers?

Enjoy this brief video, where we examine the Fibonacci numbers by using a Jupyter Notebook. It is this easy, and you can get started today!

[https://www.youtube.com/watch?v=Ge0k4kS9wE8](https://www.youtube.com/watch?v=Ge0k4kS9wE8)

In this little python video, we have a look at Fibonacci numbers. First, we try a few functions to generate the normal numbers: 0, 1, 1, 2, 3, 5, 8, 13, 21, ... Then we look at what happens between these numbers. If Fx is the xth Fibonacci number, then F7 = 8 and F8 = 13, but then what is F7.5? Join me and find out!

The notebook used in this video is available at:

[https://colab.research.google.com/drive/1K6jWQSXzhCz9sOy5SyEHA-k4samWhWhr](https://colab.research.google.com/drive/1K6jWQSXzhCz9sOy5SyEHA-k4samWhWhr)


Data Visualization and simple Regression using Dash

Hi guys, I created my first application with Dash and am excited to share it.

It's a simple tool for analyzing already cleaned datasets. You can upload any dataset but generally it caps out at 100MB. Eventually, i'm hoping to allow for bigger datasets.

site: [https://www.regress.me/](https://www.regress.me/)

source: [https://github.com/SuljicAmar/Regress.me](https://github.com/SuljicAmar/Regress.me)

I have a ton more planned for this (logistic/ mixed effects etc) but would love to hear any thoughts from others!

https://reddit.com/link/tv1tq9/video/nnintgojxcr81/player

EDIT: Added 3D plots, to initial visualizations and to fit

&#x200B;

https://reddit.com/link/tv1tq9/video/a17qsfy5hdr81/player


Python App

Hello, I did a simple app on Python. This app is making a common shortcut from several. You can test it right here: [https://github.com/naelxd/Nepo](https://github.com/naelxd/Nepo)

I will be very glad to read your opinions and advices. Thanks!

https://i.redd.it/m7ytbr2i18r81.gif


Sunday Daily Thread: What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.


Naming convention for type aliases

I recently did a remote technical challenge/interview through a company that does assessments for other companys.

I scored very well, but they made a comment that they didn't like my naming convention, and marked me down in one category. The part they didn't like was:

    SimpleTable = Dict[str, Dict[str, str]]

They're saying `SimpleTable` should be `simple_table`. I cased it the way I did because it's used as a type for hinting.

What are people's thoughts here? I can't find anything official.


A commit from my lead dev: "Improve readability".

I don't get it. Help!

https://preview.redd.it/emb8jxjrv6r81.png?width=607&format=png&auto=webp&s=871eae5047ac3c13dcba968fa2b49dd707469287


Space Science with Python - Asteroids meet Deep Learning #10

Hey everyone,

today I'd like to show you how to optimize a Conv1D network using [Keras-Tuner](https://keras.io/keras_tuner/). It enables one to automatically test some pre-defined networks; or it applies Bayesian or Hyperband optimization to find the best model!

In our case, we'll use it to find a good convolutional neural network for asteroid spectra to distinguish between 4 classes.

Link to video: [https://youtu.be/vhr48KgL-Ys](https://youtu.be/vhr48KgL-Ys)

Corresponding Code: [https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/%5BML1%5D-Asteroid-Spectra/10\_dl\_hyperparameter\_search.ipynb](https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/%5BML1%5D-Asteroid-Spectra/10_dl_hyperparameter_search.ipynb)

Please note that this is tutorial #10 in a long series of space science related videos. Feel free to take a look in the corresponding [playlist](https://www.youtube.com/playlist?list=PLNvIBWkEdZ2gagAcgm44cplgSvQ_Cmvbv) or on [my channel](https://www.youtube.com/c/Astroniz).

Tutorial #10 concludes the classification task. In the next 3 videos we'll take a look at Autoencoders and how to classify or identify different asteroid spectra in a low-dimensional latent space.

Stay tuned!

Thomas


Cloud server

I made an API to managing files remotely, it's protected from directory traversal, shells and more!

[https://github.com/ZSendokame/ViCl](https://github.com/ZSendokame/ViCl)

I wan't to improve it, so if you have any ideas or feedback please leave it on comments


Beautiful circos plots in Python

Circos is one of the most popular software packages for displaying the inter-relationships between data in a matrix. For example, in the bioinformatics field, circos style plots are often used for visualizing genomic similarities and features. However, the original package is implemented in Perl, and the other derived packages were also developed based on R or d3.js. Thus, there are no practical tools for drawing circos plots in matplotlib.

Here, I made [pyCircos](https://github.com/ponnhide/pyCircos) that allow drawing circos plots with matplotlib. By using this package, not only circos plots but also complex polar plots can be quickly drawn.

I hope the package help users visualize a beautiful polar plot.

[Example plots of pyCircos](https://preview.redd.it/v3g1huqtt5r81.png?width=2952&format=png&auto=webp&s=f8d8bf0f876d9facb27a12974793d70f9570e84b)

Additionally, example code can be executed on [Google colab.](https://colab.research.google.com/drive/1xmAnv7AHWUTA2HWfjqV1lFWkFMSLJHG0?usp=sharing)


GitHub - minimaxir/imgbeddings: Python package to generate image embeddings with CLIP without PyTorch/TensorFlow


Free and reliable language translation API for developers

Hi Pythons,

For years now, I have been developing and maintaining the [deep-translator](https://github.com/nidhaloff/deep-translator) package.

Recently, I started working on an API based on it and I want to show it to you. The API is based on fastapi and deep-translator. I deployed a "basic" version on azure, you can [try it out here](https://deep-translator-api.azurewebsites.net/)

If you want to check the API code, you can [find it here](https://github.com/nidhaloff/deep-translator-api)

I built the API as an extension to deep-translator to make it easier for other developers/enthusiasts to build apps/websites in their preferred languages and make use of deep-translator through the API.

In [this issue](https://github.com/nidhaloff/deep-translator/issues/144), I suggested building a translation website or desktop app based on deep-translator. Maybe there are people here, who will find this interesting.

&#x200B;

&#x200B;

# TL:DR

I built a free translation API based on deep-translator and fastapi.

API repo: [https://github.com/nidhaloff/deep-translator-api](https://github.com/nidhaloff/deep-translator-api)

deep-translator repo: [https://github.com/nidhaloff/deep-translator](https://github.com/nidhaloff/deep-translator)

Swagger UI: [https://deep-translator-api.azurewebsites.net/](https://deep-translator-api.azurewebsites.net/)


Help building a Python logo in r/place!

we are currently working at 1270 x 888 near the belgium flag

[https://www.reddit.com/r/placepython/comments/ttxp46/rplacepython\_lounge/](https://www.reddit.com/r/placepython/comments/ttxp46/rplacepython_lounge/)

[https://www.reddit.com/r/placepython/comments/tungzi/starting\_again\_at\_1270\_x\_888\_near\_the\_belgium\_flag/](https://www.reddit.com/r/placepython/comments/tungzi/starting_again_at_1270_x_888_near_the_belgium_flag/)


Python GUI Programming With Tkinter – Real Python


ORM by dataclass with type hints✨✨✨

&#x200B;

https://preview.redd.it/vvsaiq7yl4r81.png?width=754&format=png&auto=webp&s=b71bdbfcaabf44d9d52cf1743d1caa26c1efd92f

https://preview.redd.it/v6qf97zcl4r81.png?width=1118&format=png&auto=webp&s=281417df407d2cc011e3e02ed61da5791bcc3c3a

see more at [https://strongbugman.github.io/danio/](https://strongbugman.github.io/danio/), thanks for any suggestion


we need a python logo in r/place

let's choose a good pixel art logo and draw it somewhere.


py-terraform: Python binding for Terraform

Hi, I wrote a Python binding for Terraform which called [**py-libterraform**](https://github.com/Prodesire/py-libterraform).

Terraform is a great tool for deploying resources. If you need to call the Terraform command in the Python program for deployment, a new process needs to be created to execute the Terraform command on the system. A typical example of this is the [python-terraform](https://github.com/beelit94/python-terraform) library. Doing so has the following problems:

* Requires Terraform commands on the system.
* The overhead of starting a new process is relatively high.

This library compiles Terraform as a **dynamic link library** in advance, and then loads it for calling. So there is no need to install Terraform, nor to start a new process.

In addition, since the Terraform dynamic link library is loaded, this library can further call Terraform's **internal capabilities**, such as parsing Terraform config files.

Feel free to use it and look forward to your feedback!


An Example of Automated Hacking with Python


Gradually Migrating Python Code to asyncio


PyTermGUI now lets you export your terminal contents as an SVG screenshot!

https://preview.redd.it/qg9lyct0s3r81.png?width=1487&format=png&auto=webp&s=7659c8f8280d642bbf36ca4caf512a6377eb1202

**Note**: None of the images in this post are actual, OS-side screenshots, rather images exported by the module.

Hey there!

Inspired by Rich's upcoming offering, the newest version of my TUI project, [PyTermGUI](https://github.com/bczsalba/pytermgui) supports exporting terminal content as a window-mimicking screenshot! Unlike the aforementioned module, PTG also supports exporting positionally-printed items accurately.

We also support exporting as a plain, static HTML file which could be very useful for documentation purposes.

https://preview.redd.it/1cbazpc6s3r81.png?width=1562&format=png&auto=webp&s=2cbfee8e95bd081bb239a0ab1c21fecc2ec2eea6

https://preview.redd.it/4hxei7jot3r81.png?width=1422&format=png&auto=webp&s=e3be4313cebeb8f8f3f081ed6357a97aef1f3041

If any of this sounds interesting, feel free to check out the [release notes](https://github.com/bczsalba/pytermgui/releases/tag/v4.3.0), or join us at r/PyTermGUI!