sub
stringclasses
1 value
title
stringlengths
7
303
selftext
stringlengths
0
8.65k
upvote_ratio
float64
0.08
1
id
stringlengths
9
9
created_utc
float64
1.65B
1.65B
Python
Python Selenium Tutorial #6 - Bypass Detection using plugins, settings & proxies
0.83
t3_tnmxy8
1,648,217,926
Python
Python - LinkedIn Skill Assessments Quizzes with Answers | MeshWorld
0.36
t3_tnljc5
1,648,213,623
Python
Python Pub/Sub
Let's see how far this rabbit hole goes. It's late evening. I started reading up on networking. It's 2am. Let's see how Redis implements pub/sub under the hood. Basically, I ended up writing my own pub/sub implementation in Python: [https://github.com/Salaah01/py-pub-sub/blob/master/server/server.py](https://github.com/Salaah01/py-pub-sub/blob/master/server/server.py) ​ https://i.redd.it/u867y09txip81.gif
0.6
t3_tnkxf3
1,648,211,635
Python
Value objects with Python
Hello r/Python This is my first post here. I created a blog post about value objects with Python. [https://blog.szymonmiks.pl/p/value-objects-with-python/](https://blog.szymonmiks.pl/p/value-objects-with-python/) ​ Code examples are available on my GitHub [https://github.com/szymon6927/szymonmiks.pl/tree/master/blog/content/post/06-value-objects-with-python/value-object-examples](https://github.com/szymon6927/szymonmiks.pl/tree/master/blog/content/post/06-value-objects-with-python/value-object-examples). I hope you will enjoy it. I would love to hear your opinion
0.6
t3_tnk6p3
1,648,209,000
Python
Ethereum Price Email Alerts With Python
0.11
t3_tnjf86
1,648,206,202
Python
Reactivex like operators that can be used directly on async iterables
I'm a fan of the [operators](https://rxpy.readthedocs.io/en/latest/reference_operators.html) available in ReactiveX. I'm not a fan of observables, and all the other cruft that comes with using reactivex. I would much rather be writing async generators, and using them in async for loops. So I've started writing a library that implements the operators typically found in Reactivex libraries, and I'm posting it here for some early feedback. Source: [https://github.com/garyvdm/aiterx](https://github.com/garyvdm/aiterx) Example: >>> from asyncio import run, sleep >>> from aiterx import debounce >>> >>> async def source(): ... yield 1 ... await sleep(0.2) ... yield 2 ... await sleep(0.1) ... yield 3 ... await sleep(0.1) ... yield 4 ... await sleep(0.2) ... yield 5 ... >>> async def test_debounce(): ... async for item in debounce(source(), 0.15): ... print(item) ... >>> run(test_debounce()) 1 4 5 Have I missed some existing library that does what I need? I did looked at these before I started: * [rxpy](https://rxpy.readthedocs.io/en/latest/) * [aioreactive](https://github.com/dbrattli/aioreactive) * [async-rx](https://geronimo-iia.github.io/async-rx/) Any feedback on the work I have done so far?
0.88
t3_tnifu4
1,648,202,004
Python
Scrape Google Top Carousel Results in Python
Full code: ```python import requests, lxml, re, json from parsel import Selector # 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/99.0.4844.83 Safari/537.36" } params = { "q": "dune actors", # search query "gl": "us", # country to search from } def parsel_get_top_carousel(): html = requests.get('https://www.google.com/search', headers=headers, params=params) selector = Selector(text=html.text) carousel_name = selector.css(".yKMVIe::text").get() all_script_tags = selector.css("script::text").getall() data = {f"{carousel_name}": []} decoded_thumbnails = [] for _id in selector.css("img.d7ENZc::attr(id)").getall(): # https://regex101.com/r/YGtoJn/1 thumbnails = re.findall(r"var\s?s=\'([^']+)\'\;var\s?ii\=\['{_id}'\];".format(_id=_id), str(all_script_tags)) thumbnail = [ bytes(bytes(img, "ascii").decode("unicode-escape"), "ascii").decode("unicode-escape") for img in thumbnails ] decoded_thumbnails.append("".join(thumbnail)) for result, image in zip(selector.css('.QjXCXd.X8kvh'), decoded_thumbnails): title = result.css(".JjtOHd::text").get() link = f"https://www.google.com{result.css('.QjXCXd div a::attr(href)').get()}" extensions = result.css(".ellip.AqEFvb::text").getall() if title and link and extensions is not None: data[carousel_name].append({ "title": title, "link": link, "extensions": extensions, "thumbnail": image }) print(json.dumps(data, indent=2, ensure_ascii=False)) ``` Blog post with more explanation: https://serpapi.com/blog/scrape-google-carousel-results-with-python/
0.81
t3_tngota
1,648,193,728
Python
Build a Word Guessing Game in Python [video + source code]
Here is the link for the video : [https://youtu.be/M1t4RJ5XRHE](https://youtu.be/M1t4RJ5XRHE) Here is the link for the source code : [Word-Guessing-Game/wordgame.py at main · The-Nerdy-Dev/Word-Guessing-Game (github.com)](https://github.com/The-Nerdy-Dev/Word-Guessing-Game/blob/main/wordgame.py)
0.8
t3_tngfjr
1,648,192,532
Python
Build your own Feature Rich J.A.R.V.I.S in Python - Python Project
0.67
t3_tngd7q
1,648,192,249
Python
Meta donates $300,000 to the Python Software Foundation
0.91
t3_tnfh9l
1,648,188,306
Python
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!
1
t3_tn96gz
1,648,166,410
Python
Python for AWS Lambda Functions: A Beginner's Guide and Tutorial
[https://codesolid.com/python-and-aws-lambda-functions](https://codesolid.com/python-and-aws-lambda-functions/) I just finished this -- it's very much focused on Python developers who may not have written an AWS Lambda function before and are wondering what all the fuss is about. Enjoy!
0.83
t3_tn7qfv
1,648,162,106
Python
A simple python3 script to keep 2 folders synced
Hi r/Python, I'm here today to showcase a project that I've developed to experiment with python, github, ci/cd best practices and pytest.I'm not really a beginner, I've been coding in python for a while now (I'm a junior GCP developer). This post is just a request for feedback and/or suggestion on how to improve from more experienced python developers. Here is the repo : [https://github.com/davideolgiati/raidify](https://github.com/davideolgiati/raidify), feel free to open an issue on bug and suggested enhancements.
0.8
t3_tn733z
1,648,160,259
Python
Guido van Rossum on Twitter: It's happening! BPO is migrating to GitHub tomorrow.
0.95
t3_tn4lyj
1,648,155,805
Python
Is Spock-Config the only tool that integrates object-oriented config files and command-line interfaces?
[Spock-Config](https://github.com/fidelity/spock) allows one to create OO configuration files. That's how I roll. I currently use [PYdantic settings](https://pydantic-docs.helpmanual.io/usage/settings/) and it's great. But it does not offer command-line re-configuration of what you have in the OO config file. Sure you could manually do all the mappings yourself. But that's why I like spock. What I dont like about Spock is that [there is already another PyPI package with that same top-level-namespace](https://github.com/fidelity/spock/issues/235) ... why does PyPI even allow that? What would I do if I wanted to use both in the same project??? ### So somebody rock my world Tell me about an alternative. [Plumbum](https://plumbum.readthedocs.io/en/latest/cli.html) kinda-sorta fits the bill.... but it really is just OO CLI development.
0.67
t3_tmz4yi
1,648,150,974
Python
Performance: SQLAlchemy vs Django vs EdgeDB
0.66
t3_tmqev6
1,648,143,624
Python
IDE-style autocomplete that integrates with Python tools (pip, pyenv, etc)
​ https://reddit.com/link/tmleui/video/r3kh3f0pycp81/player
0.82
t3_tmleui
1,648,139,283
Python
Github - Multiplatform (arm7, arm64, amd64) Docker Image for Celery with precompiled gevent
0.75
t3_tmcp8z
1,648,131,220
Python
Animating a Sprite Sheet in Python w/ PyGame
0.8
t3_tmbg9f
1,648,129,996
Python
How to create a digital clock with python easily
This tutorial is about creating a project using python language. I’m going to show you how to create a digital clock with Python. Before reading the article, if you like to know more about Python, you could check out these two important articles: * [Why should I learn Python?](https://progskillss.com/why-should-i-learn-python) * [How to learn Python?](https://progskillss.com/how-to-learn-python-programming) This project is suitable for beginners. To write the code, you need to know how to use modules in Python. Two necessary modules that I use in this project are Tkinter and time. Tkinter is a GUI library that helps you develop a graphical user interface for the digital clock, and using the time module; you could get the current time, date, timezone, etc. Let’s dive deep into these modules. If you want to read more about this project, you could click on the following link: [https://progskillss.com/how-to-create-a-digital-clock-with-python](https://progskillss.com/how-to-create-a-digital-clock-with-python)
0.54
t3_tmabdm
1,648,128,741
Python
OpenTelemetry and Python: A Complete Instrumentation Guide
A blog post exploring how to instrument a Python application to emit tracing data (metric and log data interfaces are not stable quite yet). It examines: * How auto-instrumentation of the same codebase works. * The differences with manual instrumentation. * How to mix manual instrumentation with auto-instrumentation. * How to add information about exceptions. Here's the link: [https://www.timescale.com/blog/opentelemetry-and-python-a-complete-instrumentation-guide/](https://www.timescale.com/blog/opentelemetry-and-python-a-complete-instrumentation-guide/)
0.92
t3_tm8jte
1,648,127,261
Python
Web2py Framework in Python
0.6
t3_tm3sxx
1,648,121,398
Python
Tree Traversal Algorithms in Python-InsideAIML
0.85
t3_tm3jvl
1,648,120,520
Python
Scientific computation using NumPy library
0.43
t3_tm30b4
1,648,118,458
Python
Learn Python yield interactively from your browser!
0.67
t3_tm2yyc
1,648,118,307
Python
RaViewer: parsing and displaying binary data straight from camera (made with Dear PyGui)
​ [RaViewer screenshot](https://preview.redd.it/6e3n26fe7bp81.png?width=1220&format=png&auto=webp&s=9163087922bf30b0038e173e9290d6b56fa9f586) [RaViewer demo](https://i.redd.it/s4m2bmsa7bp81.gif) [RaViewer](https://github.com/antmicro/raviewer) is an open-source utility dedicated to parsing and displaying binary data acquired straight from camera. After opening a binary image, you can specify the color format, the image size and append or remove n bytes from the beginning of the image series. The binary image will be processed and shown based on these values. You can control which color channels are displayed and zoom in and out. For detailed information, you can view the hexadecimal pixel values in table format. The resulting image can be exported entirely or just a selected part to more complex formats (JPEG, PNG) or raw data. The source code is available in the project's [GitHub repository](https://github.com/antmicro/raviewer). You can read more about RaViewer in this [article](https://antmicro.com/blog/2021/11/raviewer-open-source-tool-for-debugging-video-pipelines/) by [antmicro](https://antmicro.com/). Made with Python and the GUI was created with [Dear PyGui](https://github.com/hoffstadt/DearPyGui/wiki/Dear-PyGui-Showcase).
0.92
t3_tm2wb6
1,648,118,019
Python
httpx worked fine for me... any reason to consider urllib3?
I've found [httpx](https://www.python-httpx.org/) to be very approachable for my API consumption tasks and less wordy than [urllib3](https://urllib3.readthedocs.io/). Do you have a preference for API consumption (perhaps requests) and why?
0.73
t3_tm1grs
1,648,111,891
Python
I created a Python Script to find out Broken links by scanning entire WordPress Website
I created a Python script to check links in all the WordPress posts to find out broken ones. I tried creating this after learning multi-threading based, I had this idea for so long because other broken link checking software such as SiteBulb and ScreamingFrog take very long time (\`24 hours) to crawl a one of my websites (having around 28000 posts). So, instead of crawling, I used WordPress API and this way it is much faster. I will modify it later to do the same thing for non-WordPress website, by analyzing the sitemap. It goes through all the posts one by one from WordPress API, extract all the URLs from <a> tag and then checks their status by making a HEAD request. 404 and other status codes are recorded. If the HEAD request fails, then name of the exception class is recorded. Finally, save the report in CSV file. [wpbroken script in action](https://preview.redd.it/30t209zd0ap81.png?width=1366&format=png&auto=webp&s=1ad89fc845ee0e77ee20197b0a887301b46f9748) GitHub Gist: [wpbroken.py](https://gist.github.com/ilovefreesw/fa763e1f84cd9f7101dc4816e293beda)
0.92
t3_tlzj7n
1,648,103,526
Python
5 Python Libraries for Automating OSINT Operations
0.91
t3_tlz7q5
1,648,102,201
Python
Tutorial on GPU-based ray-casting with Python
If you are interested in doing 'shadows' for a 2D game, here's a tutorial: [https://api.arcade.academy/en/development/tutorials/raycasting/index.html](https://api.arcade.academy/en/development/tutorials/raycasting/index.html) https://preview.redd.it/fd1dyzmoi8p81.png?width=1200&format=png&auto=webp&s=92fd25296d83102fd08e5d8f21b59d5d07c2e80f
0.94
t3_tlsb8q
1,648,085,480
Python
Including packages in project
I've been working on project for a raspberry pi, which I've been writing on my PC in Pycharm, and SSHing over to my pi. What's the best way to move the whole project over, including the dependencies? Been just manually adding them on the pi and realized there has to be a better way. Thanks!
0.67
t3_tlp1vn
1,648,082,311
Python
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.**
0.67
t3_tlmt0a
1,648,080,009
Python
Coin toss probability
import random from collections import Counter import itertools ##method for coin toss def cointoss(): rand_i = random.randint(0, 1) outcomes = ["Heads", "Tails"] #outcomes = [0,1] return outcomes[rand_i] #create list list=[] ##Number of coin tosses n=3 ##calls method and adds to the list for i in range(0, n): t1 = cointoss() list.append(t1) print(list) Counter(list) print(Counter(list)) ##compare previous coin tosses with the last for index, i in enumerate(list): for j in list[index+1:]: print("list item i "+str(i)) print("list item j " + str(j)) if i==j: print("Same") else: print("Not the same") ​ I'm trying to edit this code so that it outputs the number of times a certain side occurs in a row. ​ So for example, a person makes ten coin toss, how many times does heads occur three times or two times in a row. ​ Any suggestions on how to edit it?
0.44
t3_tlkryn
1,648,077,791
Python
Can we get hired just to do EDA’s in Python ? Exploratory Data Analysis using libraries-
I’ve been relatively new to Datascience, spent couple of years with sql, r, python, power BI & tableau.. I’ve specifically loved getting involved with EDA’s - what do you guys think ?
0.33
t3_tli7e4
1,648,073,230
Python
Where will Python be in the Web3 space?
Hi guys, I noticed that there are two prominent libraries for web3 applications: [web3.py](https://web3.py) and web3.js . After doing some searching online, I have found there is some preference for web3.js over [web3.py](https://web3.py). Does this mean that Python might be obsolete in Web3?
0.32
t3_tlhee1
1,648,072,417
Python
Pants 2.10: Multiple Python lockfile support, PyOxidizer, Thrift codegen, and better linter parallelization
0.8
t3_tlgwka
1,648,071,777
Python
Programming community for freetime team projects
The problem: I started learning programming 3 year ago, partly in university, partly at home, and built a few larger projects since then. I have a lot of new ideas for projects, which are fun, but could also be profitable if done right. The problem is the scale of these imagined projects is too large to handle them all by myself. Hiring developers doesn't feel like a solution for me. I would love to build projects together with other "advanced" programmers and exchange ideas, learn from each other, inspire each other. But how do I find people who are interested aswell? The Solution: A more private, trustbased community of developers, who have time and energy to contribute unpaid work to programming projects. People could share and discuss ideas, group together in teams and start projects. Also if there is an intention to turn projects profitable teams could determine at the beginning how profits will be shared. I imagine this community as a discord server right now, but could be something else of cause. ​ \-Does anyone know if a community like this exists somewhere? \-If no are there people here interested in starting a discord server to fill this purpose? ​ Thanks for reading and greetings from Hamburg, Maxim
0.67
t3_tlg6u2
1,648,070,961
Python
Custom BurpSuite extensions in Python: recreating Cloud2Butt
0.72
t3_tlg281
1,648,070,801
Python
Text Similarity w/ Levenshtein Distance in Python
0.67
t3_tldsug
1,648,068,506
Python
Mail merge in python
I have a excel/CSV data where in a single customer has multiple orders in different lines. Can I generate a list of text files in which each customer's multiple orders are present. Much like a invoice copy. Any clues on how to do this is highly appreciated ... PS ... I am learning python
0.8
t3_tl9dbz
1,648,063,812
Python
i created a game controller using Arduino touch sensor and python
0.5
t3_tl3raq
1,648,057,722
Python
Creating a Python CLI with Go(lang)-comparable startup times
Hi Folks. I recently put some effort into creating a command line interface (CLI) made with Python. Background: I started a new project called Gefyra, a tool for local application development directly with Kubernetes. Check it out the website [https://gefyra.dev](https://gefyra.dev) or have a glance at the code [https://github.com/gefyrahq/gefyra/tree/main/client](https://github.com/gefyrahq/gefyra/tree/main/client) I'd like to have an executable with (almost) the startup performance of `kubectl` (the executable to control a Kubernetes cluster). That means, I need fast startup times (which is crucial for a CLI) and ideally just one file (which is statically-linked) for easy distribution. In addition, I’d like to provide executables for Windows, MacOS and Linux. For those requirements people would usually go for Go (needless to say it's awesome), however I started out with a prototype written in Python and it evolved over time. So I tried to find a way to make this work with Python. I went the following way: 1. PyInstaller: [https://pyinstaller.readthedocs.io/en/stable/](https://pyinstaller.readthedocs.io/en/stable/) 2. Nuitka: [https://nuitka.net/](https://nuitka.net/) 3. PyOxidizer: [https://pyoxidizer.readthedocs.io/en/stable/](https://pyoxidizer.readthedocs.io/en/stable/) **PyInstaller** PyInstaller was quite easy to set up. However, the resulting executable was complained about by Virustotal (see: [https://www.virustotal.com/gui/home/upload](https://www.virustotal.com/gui/home/upload)) because of PyInstaller's bootloader. Somehow the code signature was also found in viruses (lol). To workaround this I compiled a bootloader myself which at least removed the virus issues. On MacOS I faced startup times of more than 10 s with internet connection and about 3 s without internet connection. Interestingly, the former docker-compose command was also created from PyInstaller and Mac users complained about the startup performance, too: [https://github.com/docker/compose/issues/6956](https://github.com/docker/compose/issues/6956) :) I didn’t find much to improve. The concept of PyInstaller will potentially always be a problem for fast startup times (which IMHO makes it unsuitable for CLI applications). **Nuitka** With Nuitka, I generated very large binaries of about 150 Mb. The startup performance was already much better than PyInstaller for Mac and Linux. However, I was not completely satisfied and very long compile times bothered me a little bit (about 10 min). **PyOxidizer** I ended up using PyOxidizer. This well-crafted toolkit compiles Python to Rust code and also includes all dependencies into one handy binary executable. With no special optimizations I saw startup times of about 700 ms. That is almost acceptable, though I wanted to go a little further. I started to examine the output of `python -X importtime -m gefyra 2> import.log` just to check the imports. There is an awesome tool to analyze the Python imports: tuna (see: [https://github.com/nschloe/tuna](https://github.com/nschloe/tuna)). `tuna` allows analyzing the import times from the log. Run it like so `tuna import.log`. It opens a browser window and visualizes the import times. With that I was able to manually move all imports to the functions in which they are needed (and bring in some other optimizations). This greatly violates PEP 8 ([https://peps.python.org/pep-0008/#imports](https://peps.python.org/pep-0008/#imports)) but leads to very fast startup times. These are the startup values I finally reached with `gefyra` under average modern Ubuntu: > python -m timeit "__import__('os').system(gefyra)" 10 loops, best of 5: 33.5 msec per loop Pretty neat, isn’t it? In comparison the `kubectl` executable: > python -m timeit "__import__('os').system('kubectl')" 10 loops, best of 5: 24.9 msec per loop In addition, I created GitHub actions to run the PyOxidizer builds once a new version is released (see: [https://github.com/gefyrahq/gefyra/blob/main/.github/workflows/dist-build-linux.yaml](https://github.com/gefyrahq/gefyra/blob/main/.github/workflows/dist-build-linux.yaml)). Only Windows is missing at the moment. Although, PyInstaller and Nuitka did not deliver the best startup times, I would not say it's bad software. They probably shine at other aspects. I hope these insights can be useful for someone else, too.
0.82
t3_tl3jwz
1,648,057,171
Python
“Like it or not, it’s going to be primarily up to Python devs to crush the business side’s dreams AI can magically make their company better.” The CTO of an AI company explains why AI can be a waste of time and resources at most companies primarily because it’s retrofitted onto existing products.
0.91
t3_tkyuz8
1,648,052,349
Python
Minos Demo - Stocks Index Wallet with Microservices
1
t3_tkv9ax
1,648,045,935
Python
Python Timer Functions: Three Ways to Monitor Your Code – Real Python
0.8
t3_tkv08a
1,648,045,223
Python
The top 5 advanced Python highly rated free courses On Udemy with real-world projects.
Hello, ​ [Top 5 Python free courses](https://preview.redd.it/9p3qq8gacbp81.png?width=1024&format=png&auto=webp&s=b225e18de619f201c4aa711d229a72b5a7704aa2) **The top 5 Python highly rated free courses On Udemy with real-world projects.** [Course1: Applied Deep Learning Build a Chatbot Theory And Application.](https://www.udemy.com/course/applied-deep-learning-build-a-chatbot-theory-application/) [Course2: Master Data Analysis with Python Intro to Pandas.](https://www.udemy.com/course/master-data-analysis-with-python-intro-to-pandas/) [Course3: Machine Learning Crash Course for Beginners.](https://www.udemy.com/course/easy-machine-learning/) [Course4: The Art of Doing Video Game Basics with Python and Pygame](https://www.udemy.com/course/the-art-of-doing-video-game-basics-with-python-and-pygame/). [Course5: Master Data Analysis with Python – Selecting Subsets of Data.](https://www.udemy.com/course/master-data-analysis-with-python-selecting-subsets-of-data/) The Courses List: [https://netslovers.com/2022/03/17/advanced-python-free-courses-udemy/?feed\_id=277&\_unique\_id=623390a11ddad](https://netslovers.com/2022/03/17/advanced-python-free-courses-udemy/?feed_id=277&_unique_id=623390a11ddad) I hope you found this post helpful.
0.87
t3_tkuqsi
1,648,044,502
Python
(I think) I stress tested matplotlib for real-time graping.
​ [Matplotlib Stress Test](https://i.redd.it/x3xvfvmeq4p81.gif) It can run at 60 FPS if you push it to its limits, which is more than I need. There are occasional hiccups, but I think it's fine. I am developing a simple GUI for an open-source DAQ module called [PlainDAQ](https://www.crowdsupply.com/kuncu-teknoloji/plaindaq). Before I start, I decided to stress test it to see if it can handle fast changing waveforms. I think this is pretty enough for my application Here is the [code](https://github.com/AlperenAkkuncu/PlainDAQ/blob/main/Development/GUI/sinewave_stress_test.py) **What more can I do to make it smoother? One guy in eevblog suggested me to look into garbage collection. What are your opinions?**
0.79
t3_tkt5v8
1,648,039,696
Python
Python Generators
0.72
t3_tksmex
1,648,037,852
Python
Bloxs: display your data in an attractive way in your notebook
Hi, I would like to share with you a small python package that I've created to display data in a notebook in an attractive way. The package is called `bloxs` and is available on GitHub https://github.com/mljar/bloxs The package can display as a block following data: - number with the title - progress bar - chart (can be a line, stepped line, bar) What is more, there can be several blocks displayed in one row. The implementation is very simple, there is only one class, called `B`. It displays a single block or row of blocks. Each object of the `B` class has the `_repr_html_()` method that returns the HTML with a block. A very basic example: from bloxs import B B(1234, "Bloxs in a notebook!) The package works with Jupyter Notebook, Google Colab, Deepnote, and Kaggle. I hope you find it useful and it will help you to create beautiful dashboards, reports, and apps directly from the notebook.
0.74
t3_tkrlom
1,648,034,233
Python
How To Automate Your Statistical Data Analysis
0.75
t3_tkpe69
1,648,024,528
Python
The Right Way to Compare Floats in Python
0.78
t3_tkp7wz
1,648,023,709
Python
Spotify LED Matrix
I created an LED matrix that takes your currently playing spotify song and displays it to an led panel. It uses a raspi 0w to create one thread to get data from the spotify api, and another to update the board. The code is rough around the edges, but I hope y'all enjoy it! Demo: https://reddit.com/link/tkp0xt/video/56ihrzuzb3p81/player Repo: [https://github.com/Evan-Nishi/spotify-panel-client](https://github.com/Evan-Nishi/spotify-panel-client) (stars would be appreciated :D)
0.9
t3_tkp0xt
1,648,022,796
Python
Yet another simple wordle searcher
It is a script that will help narrow down the list of possible solutions to a wordle puzzle. In the end, you still have to use your grey matter, and, depend on luck. It scrapes data from Lou Hevly's website (which provides a regex search functionality). And then it applies some simple filtering algorithms on the results. Script & docs: [https://gist.github.com/deostroll/6014bd0cf3cc4b0a22894d0981cacddc#file-wordle\_search-py](https://gist.github.com/deostroll/6014bd0cf3cc4b0a22894d0981cacddc#file-wordle_search-py) [2 minute video](https://www.youtube.com/watch?v=Js2DNbNynw4), where I am thinking a lot, but eventually defer to the script for help...But in the video I had used selenium/msedge. Later decided to use python requests and beautifulsoup...that is whats shared above...
0.57
t3_tkoi7q
1,648,020,431
Python
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.
0.67
t3_tkgwne
1,647,993,608
Python
Flask web blog
Some days ago i made a Blog based-on Flask, it lets you add a custom password, username, upload small comments with HTML and it has a basic user authentication system! I called it "comments" (because of it's feature, it let's you to post small text with custom HTML) [https://github.com/ZSendokame/comments](https://github.com/ZSendokame/comments) ​ I wan't ideas and/or feedback about how to improve it! Bye
0.87
t3_tkgecq
1,647,992,128
Python
I Created a Visualization Package for Soccer
I’ve put my package on PyPi. The world of sports analytics, at least for soccer, is restricted. I wanted to learn how to analyze a game but found a large lack of data. Even worse, a lack of applications. I decided to creat my own Python package and help educate the public through my website. I’ve made a YouTube tutorial to help others get started as well. https://youtu.be/tZlrULiN26E The PyPi package is todofcpy
0.57
t3_tkgccb
1,647,991,972
Python
Meta deepens its investment in the Python ecosystem
0.95
t3_tkedpx
1,647,986,506
Python
I made bubble slort. I dont think it looks clean but it works. Comments both in Polish and English
Here is image and link [https://github.com/bibi100101/Bubble-Sort](https://github.com/bibi100101/Bubble-Sort) https://preview.redd.it/t1oni4fc60p81.png?width=1920&format=png&auto=webp&s=76703d2816371f63a113f7d32130aa0cfaae37de Showcase Translation: \-Lista Wcześniej = list before \-Lista Pozniej = list after https://preview.redd.it/cnqeybzq60p81.png?width=1359&format=png&auto=webp&s=e7f108267104423cdcc723689deb5d4b2c4953e9
0.5
t3_tkdp7o
1,647,984,659
Python
Declarative command line parser library [Heated Arguments]
I was trying out a bunch of different command line parser libraries recently and wanted to see if I could take a different approach. I have a proof of concept for a command line parser that let's you define parameters and sub-commands in a declarative way. I have a repository with a couple demo scripts to show what the interface looks like and I was hoping to get some feedback if it looks interesting enough that I should keep developing it. Thanks! https://github.com/mjcaley/heated
0.72
t3_tkcfmu
1,647,981,274
Python
Today i released a small package called geoiter. Used for web scraping
# geoiter iterates the planet. **edit** A simple tool to iterate coordinates within given boundaries. The usage is mostly for querying/searching by location. Geoiter provides many locations within a boundary, like a country. Let's say Germany has in sum 5000 houses to sell. Then most platforms will only allow you to visit the first 200 houses. Now to get the others, you need to dissect the big boundary area into smaller ones. And this is where geoiter provides you with coordinates you can find the source on [https://github.com/cloasdata/geoiter](https://github.com/cloasdata/geoiter) **/ edit** ​ https://preview.redd.it/vlzva9z6rzo81.png?width=665&format=png&auto=webp&s=72c8ebf635d7ae8ec3bfcbf1f74217fd53065daf **geoiter** can be used for web scraping to utilize geo/location queries: ​ ​ https://preview.redd.it/kdypecx8rzo81.png?width=1590&format=png&auto=webp&s=930cb8c7837bb1b1d9a80718b12538c713f229b0 In many cases the web page restrict the result items to a fixed number. With geoiter you can now dissect this one query to a many location queries to relax the result density under the restriction limit. geoiter has only one additional dependency called [haversine](https://pypi.org/project/haversine/). ## install pip install geoiter ## usage import pickle from geoiter.util.ressource_example import germany from geoiter import GeoIter # get you boundary for example with open(germany, "rb") as file: germany = pickle.load(file) # prepare gi = GeoIter( boundary=germany, radius=100, comp_rate=20 ) if __name__ == "__main__": # plot them as example for coordinate in gi: print(coordinate) ## speed one may consider that geo data have mb of coordinates. Which may make the this iteration very slow, because it needs to look up coordinates in the boundary often. To accelerate the **geoiter** provides a very simple compressor and uses bisect instead of list iteration. However, it still can be slow. ## extensions There two extensions which give additional help pip install geoiter["gpx] provides you with an gpx exporter. pip install geoiter["plot"] provides a plotting function to visualize the grid. ## data get boundaries from osm or others sources like * [https://www.geoboundaries.org/](https://www.geoboundaries.org/) * [https://osm-boundaries.com/](https://osm-boundaries.com/) * ...
0.94
t3_tkbqms
1,647,979,432
Python
Directories in Python
Directories in Python https://youtu.be/Qip7MToDr18 \#python #python3 #directories #os #PythonProgramming #tutorial #PythonForResearchers
0.1
t3_tkb40y
1,647,977,755
Python
Top 5 Benefits of Python Web Development That You Need to Know
0.29
t3_tk9o0p
1,647,973,886
Python
I made a tutorial on How to convert Images to ASCII using pygame
Hi everyone! I have been looking at various image filtering libraries, and some of them have image to ASCII filters. So I thought, why not make it using pygame? Tutorial can be found [here](https://www.youtube.com/watch?v=oEacnqQgE4A) Source code can be found [here](https://github.com/tank-king/Tutorials/tree/main/Python%20Pygame/image_to_ASCII) ​ [Image to ASCII](https://i.redd.it/7zvoo287azo81.gif)
0.89
t3_tk9jqo
1,647,973,579
Python
Scrape Google Scholar Profiles from a certain University in Python
0.75
t3_tk8itk
1,647,970,895
Python
Text editors are stupid, change my mind
WHAT is the point of text editors for Python? Sure, they make you code faster but why not choose the standard IDLE? I mean, PyCharm never helped me. It always made a simple project too complicated to save. SO WHY CHOOSE TEXT EDITORS?
0.08
t3_tk7umy
1,647,969,075
Python
Running a live 45-minutes session on the fundamentals of observability, OpenTelemetry, and distributed tracing in Python
Hi everyone, there's a live OpenTelemetry and observability fundamentals session - Wednesday, March 30 at 11 AM PST. **You will learn how to instrument your apps to capture traces with OpenTelemetry in Python.** 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 - this is the place to be! Register here [https://www.aspecto.io/get-started-with-opentelemetry/](https://www.aspecto.io/get-started-with-opentelemetry/?utm_source=post&utm_medium=reddit&utm_campaign=r-python-opentelemetry-workshop-pyhon-march-30-2022)
0.72
t3_tk71j6
1,647,966,912
Python
We developed a Python tool to generate a map of your embedded or edge distributed system
Hi guys, we recently developed a Python tool that allows you to generate and visualize a map of your embedded or edge distributed system. With the open-source project r/Luos, we are trying to code and make accessible CI/CD for these systems. Is this feature useful for your needs? ​ [Routing Table Luos](https://preview.redd.it/r66ib7hniyo81.png?width=570&format=png&auto=webp&s=d0d8c32b52d368c8d92a2e62e3dca49c77aced25)
0.77
t3_tk69zo
1,647,964,904
Python
I've released a cache backend that uses dynamodb which is compatible with Django's cache framework.
Hello Pythonistas! I've released a cache backend that uses dynamodb which is compatible with Django's cache framework! please enjoy :) https://github.com/xncbf/django-dynamodb-cache
0.8
t3_tk54q8
1,647,961,771
Python
Unraveling the Mystery Behind Background Filters in Video Calling Apps
Ever wondered how video calling apps apply background filters during meetings and replace the background in the video with a background of your choice. This article explains this concept in detail and guides in step by step to implement one in Python. ​ [https://medium.com/geekculture/unraveling-the-mystery-behind-background-filters-in-video-calling-apps-6802507f88a0](https://medium.com/geekculture/unraveling-the-mystery-behind-background-filters-in-video-calling-apps-6802507f88a0)
0.5
t3_tk40cc
1,647,958,616
Python
GitHub - gretelai/gretel-python-client: The Gretel Python Client allows you to interact with the Gretel REST API.
0.5
t3_tk3uqx
1,647,958,170
Python
Python Project Workflow
0.74
t3_tk1o33
1,647,951,494
Python
I've been a bit confused on which data class library to use. I wrote this article as part of my own investigation into protobuf, pydantic, etc..
0.75
t3_tk0i4d
1,647,947,327
Python
Launching Open Source python library, VevestaX: track your Machine Learning experiments and features in an excel using 5 lines of code
Hi everyone! We have launched an awesome open source python project that we have developed. We have created a Python module named **VevestaX:** Easiest library in to track Machine learning experiments and features in an excel file with 5 lines of code ! You can check out the source code at our **GitHub page**: [https://github.com/Vevesta/VevestaX](https://github.com/Vevesta/VevestaX) Please find a sample output file [https://docs.google.com/spreadsheets/d/1iOL3jiiQ834\_vep5E4fPpxj7QDGVxOBJ/edit](https://docs.google.com/spreadsheets/d/1iOL3jiiQ834_vep5E4fPpxj7QDGVxOBJ/edit) **Please register** [https://forms.gle/samkZ1gDR53xDvPg7](https://forms.gle/samkZ1gDR53xDvPg7) **as beta testers**. Eager to hear from you. We are also reachable on [vevestaX@vevesta.com](mailto:vevestaX@vevesta.com). **Please star our repository if you want to see it grow !**
0.57
t3_tjz9fx
1,647,942,213
Python
Gufo Err: Python error handling framework
[Gufo Err](https://pypi.org/project/gufo-err/) is the flexible Python error handling framework. We'd used the same approach in the [NOC](https://getnoc.com/) for a long time. Now we reworked it as an independent component. Besides the extended tracebacks and *Sentry* integration it offers a middleware-based approach for error handling, reporting, analysis, and mitigation. Fail-fast behavior allows detecting unrecoverable errors and quick termination of the application. Error handling done right is a good foundation for all ranges of python applications, from simple automation scripts to high-load services.
0.6
t3_tjykut
1,647,939,172
Python
Asynchronous Web Scraping With Python GRequests
0.77
t3_tjy5ed
1,647,937,217
Python
python syntax
does anyone feel like changing languages because of how anyone can understand python syntax? i feel like its cooler writing code that no one can ynderstand.. maybe its just me
0.28
t3_tjxth4
1,647,935,730
Python
PEP 675 titled "Arbitrary Literal String Type" just got accepted.
0.91
t3_tjx689
1,647,932,830
Python
How to be a Successful Python developer: Tips to help your hiring prospects
0.11
t3_tjwwnn
1,647,931,691
Python
Just learned implementing decorators
Hi, I just learned how to make my own decorators and want to know some examples to use them. Some are using a `timer` decorator or a `log` decorator. Would like to get more examples to start thinking about the possibilities. Thanks in advance! EDIT: Thank you everyone 🙏🙏🙏
0.75
t3_tjv4c3
1,647,924,427
Python
The code for `import this` is amazing
Maybe this has been shared here before, but I recently took a peek at the code for the `this` module (the famous `import this` Easter egg that displays Tim Peters' "Zen of Python"). I think it might be the greatest "do as I say not as I do" code example that I've ever seen. s = """Gur Mra bs Clguba, ol Gvz Crgref Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. Fvzcyr vf orggre guna pbzcyrk. Pbzcyrk vf orggre guna pbzcyvpngrq. Syng vf orggre guna arfgrq. Fcnefr vf orggre guna qrafr. Ernqnovyvgl pbhagf. Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. Nygubhtu cenpgvpnyvgl orngf chevgl. Reebef fubhyq arire cnff fvyragyl. Hayrff rkcyvpvgyl fvyraprq. Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff. Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg. Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu. Abj vf orggre guna arire. Nygubhtu arire vf bsgra orggre guna *evtug* abj. Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn. Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) print("".join([d.get(c, c) for c in s])) Seriously! You can see it [here](https://github.com/python/cpython/blob/main/Lib/this.py). Beautiful is better than ugly unless you're Tim Peters and can make something that is both beautiful AND ugly!
0.67
t3_tjskz4
1,647,915,671
Python
would it be more human readable if we had a "the" and "where" keywords that turned this: [item for item in items < 0] into: [the item in items where item < 0]
The reason I ask is because I was wondering if list comprehension always starts with item for item in items? if so, it's so inefficient and clumsy to always write thing for thing in things if... rather than just the thing in things where... Please be kind if this is the stupidest idea ever. It was just a thought.
0.24
t3_tjr17p
1,647,910,929
Python
Useful Tools and Programs list for Python
Useful Tools and Programs list for Python including learning resources, development tools , and frameworks. [https://github.com/mikeroyal/Python-Guide](https://github.com/mikeroyal/Python-Guide)
1
t3_tjqlra
1,647,909,621
Python
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.
1
t3_tjpsnz
1,647,907,211
Python
LPT: Pandas DataFrames have a "to_clipboard" method
For those that don't know, Pandas has very useful to_clipboard and read_clipboard methods that make it easy to drop a DataFrame into an Excel sheet or to move it across python sessions without having to read and write CSV files. This is really useful for me and I hope it will help you too!
0.97
t3_tjodin
1,647,903,155
Python
My TUI now automatically downgrades RGB colors to the richest palette available in your terminal!
​ https://preview.redd.it/56i77k4h6to81.png?width=1150&format=png&auto=webp&s=8b1cbeb3f7d719c0c47d5c9c11dc08cfa806e138 [PyTermGUI](https://github.com/bczsalba/pytermgui), my terminal user interface library has now gained the ability to determine the highest-grade color that can be displayed in the terminal emulator it is running in, so that it can convert anything you would normally not be able to see into a color supported. This calculation is done with human perception of colors and brightness factored in, so it looks surprisingly accurate, even with only 16 colors. It also gained extensive [https://no-color.org](https://no-color.org) support, turning all the colors that would normally be displayed into an xterm-256 greyscale based on their luminance & brightness, once again using human-based formulae. ​ https://preview.redd.it/4m0otk4h6to81.png?width=1150&format=png&auto=webp&s=a912b1f662ea7b3653805ffacaa4ab04974cd4b3 If this interests you, check out the [release notes](https://github.com/bczsalba/pytermgui/releases/tag/v4.2.0), see our [subreddit](https://reddit.com/r/pytermgui) or simply install the module with [PIP](https://pypi.org/projects/pytermgui)!
0.77
t3_tjnd4p
1,647,900,398
Python
I'm making my own 3D engine ! (I'm trying my best to improve the projection system but it's still garbage for now)
Source code: https://github.com/uItimatech/Python-3D-engine Demo: https://youtu.be/W-oaCeMkQkw
0.81
t3_tjlv0x
1,647,896,295
Python
What is the difference between PyInstaller and PyOxydizer?
0.14
t3_tjla5f
1,647,894,759
Python
We created a tool to enrich your datasets
Hi everyone! I’m Nathan, working on [subsets.io](https://subsets.io/), a platform where you can upload datasets, and get matched with relevant external data which you can add with one click. I've created a prototype to access our platform via sdk: ​ https://i.redd.it/wp7qu2xy8so81.gif Our goal is to make it easier to pull in relevant external data. No more dealing with APIs and their rate limits, pagination, etc. Do you think this is be useful? Would love to hear your thoughts
0.67
t3_tjjdcf
1,647,889,658
Python
Programmable HTTP CLI Tool
Instead of rewriting the same requests or sending a few data one by one while testing the api, I wrote a programmable http tool that can make many requests at once. [https://github.com/SinanKanidagli/httpy](https://github.com/SinanKanidagli/httpy) Some key features: * Expressive and intuitive syntax * Formatted and colorized terminal output * Programmable requests * Multiple requests one line * Value incremented each time * Random number per request * Read each value from the lines in the file * Value per each request as a list of multiple values * Built-in JSON support * Arbitrary request data * Custom headers
1
t3_tjhae1
1,647,884,233
Python
I wrote a short article about the advantages and disadvantages of python with an example of how to use Python for working with data.
[https://dev.to/patrikbraborec/why-you-should-use-python-for-your-next-project-1lin](https://dev.to/patrikbraborec/why-you-should-use-python-for-your-next-project-1lin)
0.63
t3_tjcr91
1,647,871,996
Python
Python Interpreter API? but a little bit better (Coding 101)
Coding 101 is a API that you can use in making an application similar to leetcode, codewars and other platforms that helps you practice technical interviews. Example calls are getting an easy question this API GET call will return the following {"Id": 23 "Description": "Create a Function and Name it Add and it will take 2 arguments and will return the sum of these 2 arguments" FunctionName":"Add(a,b)" "Level":1 } ​ [API GET QUESTION CALL](https://preview.redd.it/xahvguwrgro81.png?width=940&format=png&auto=webp&s=6c016a3e5d9e867b71187439125bca510f5e7987) ​ After receiving your first Api request call you can now call the PostCode api call which is a POST request you will send a json object that will contain your answer to the question and the Question ID. See example below ​ {Code: 'def Add(a , b) : return len(a)', Id: 23} ​ ​ [Tests return](https://preview.redd.it/s0laomztgro81.png?width=940&format=png&auto=webp&s=f1bd860da8e91927516271ff82ef35349c6c8341) ​ It will return the output of your answer respectively above picture is an example if your code gets accepted on all 3 testcases. If you get it wrong see below picture for the incorrect output ​ [Incorrect Output](https://preview.redd.it/fnl46dbwgro81.png?width=940&format=png&auto=webp&s=4e141aec346b6c1bbf4c291dbb04863c8ad1ccbf) ​ And That’s It! Now you can create your own Website like leetcode , codewars if you have any creative ideas go ahead :D api link [https://rapidapi.com/pacejhayict--7\_la6-gv3/api/coding101](https://rapidapi.com/pacejhayict--7_la6-gv3/api/coding101)
1
t3_tjffhc
1,647,879,245
Python
Tetris in Pygame
Just my casual project [Demo](https://youtu.be/DjAszPLisic)|[Source Code(GitHub(Fixed))](https://github.com/Jatan-Bhatt-21/Tetris) :P
0.63
t3_tjeoz6
1,647,877,303
Python
Video: Build a Speech Recognition System on a Raspberry Pi
0.67
t3_tjenh3
1,647,877,197
Python
I Use Python for Soccer Analytics
Hello Pythonauts! I use python for Data Analytics; specifically for soccer. I am a Software Developer but this is a passion project for me. On my website, [TodoFootballClub](https://todofootballclub.com/), I write about soccer and the burgeoning use of data in the game. All of my studies are done in python as it is my favorite language to use. I've done a case study on fatigue in soccer in this article: [https://todofootballclub.com/?p=620](https://todofootballclub.com/?p=620) I provide the full code in the article as well. I'd love to hear what you think! https://preview.redd.it/qn7xlb186ro81.png?width=984&format=png&auto=webp&s=86156733e61b2baa55d1be441caf47a44c31b614 ​ https://preview.redd.it/ls08atns5ro81.png?width=982&format=png&auto=webp&s=cfeb2be3ad82bcff75b23b35fb8572030366f7c3
0.72
t3_tje08f
1,647,875,451
Python
When do you use generators?
I know what they are, but I never write code and come to a point where I go "ah yeah, perfect place to use a generator" How do you guys recognize that right case or what's the common pattern where you use it and why?
0.95
t3_tjd9l1
1,647,873,449
Python
Async web server on ESP32 using Microdot | Micropython tutorial
Comprehensive written (and video!!) guide on how to use Microdot for your Micropython projects. Includes how to deal with more advanced async coding, i.e. running web server while making pretty neopixel animations. [https://bhave.sh/micropython-microdot](https://bhave.sh/micropython-microdot) If you have questions or comments, please let me know below!
0.7
t3_tjd7b8
1,647,873,272
Python
I created a sorting algorithm, it is a schrobogosort. Basically it bogosorts and if it isn't sorted there is a 50% chance to shut down your PC every time it fails to sort
[https://replit.com/@KieranMcevoy/SchrodingerSort?v=1](https://replit.com/@KieranMcevoy/SchrodingerSort?v=1) WARNING: THIS WILL SHUTDOWN YOUR PC IF RAN OFF AN IDE NOT REPL
0.63
t3_tjcn6j
1,647,871,678
Python
Aproches to planning a project
Tldr: Are there any tools/tips/tricks you guys use when starting out/ mapping a new project? Or rewriting an existing one? I mainly use python to analyze data from experiments i run in as part of my phd. So for the past few years it's been very sufficient to simply create scripts per job/project i work on. But I'm getting to a point where I'm trying to rework things so it's easier to understand - and for that i want to kind of map out what different steps i do overall. I guess the most basic way to represent this would be to say i have: input data -> parsed and combined to a csv -> different calculation -> different plots It's obviously more complex but that is where i get lost - i can't think of a way to represent all the things i do. And it got me wandering since i guess this is a widely spread issue - how to layout a big project. So again - any resources/tools/tips/tricks would be appreciated
1
t3_tjcfcy
1,647,871,105
Python
All-in-One Python book bundle by Packt
0.89
t3_tjbbj6
1,647,867,698
Python
I have my own database that I wanna check plagiarism against, how difficult is it making a plagiarism checker?
0.4
t3_tjb86q
1,647,867,437