sub
stringclasses
4 values
title
stringlengths
3
304
selftext
stringlengths
3
30k
upvote_ratio
float64
0.07
1
id
stringlengths
9
9
created_utc
float64
1.6B
1.65B
Python
Pants 2.10: Multiple Python lockfile support, PyOxidizer, Thrift codegen, and better linter parallelization
nan
0.78
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
nan
0.67
t3_tlg281
1,648,070,801
Python
Text Similarity w/ Levenshtein Distance in Python
nan
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.67
t3_tl9dbz
1,648,063,812
Python
i created a game controller using Arduino touch sensor and python
nan
0.45
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.84
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.
nan
0.91
t3_tkyuz8
1,648,052,349
Python
Minos Demo - Stocks Index Wallet with Microservices
nan
1
t3_tkv9ax
1,648,045,935
Python
Python Timer Functions: Three Ways to Monitor Your Code – Real Python
nan
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.76
t3_tkt5v8
1,648,039,696
Python
Python Generators
nan
0.71
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.76
t3_tkrlom
1,648,034,233
Python
How To Automate Your Statistical Data Analysis
nan
0.79
t3_tkpe69
1,648,024,528
Python
The Right Way to Compare Floats in Python
nan
0.65
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.87
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.6
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.72
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.8
t3_tkgccb
1,647,991,972
Python
Meta deepens its investment in the Python ecosystem
nan
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.56
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.63
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.11
t3_tkb40y
1,647,977,755
Python
Top 5 Benefits of Python Web Development That You Need to Know
nan
0.25
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
nan
0.87
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.11
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.86
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.75
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.82
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.
nan
0.5
t3_tk3uqx
1,647,958,170
Python
Python Project Workflow
nan
0.63
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..
nan
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 [[email protected]](mailto:[email protected]). **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
nan
0.6
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.22
t3_tjxth4
1,647,935,730
Python
PEP 675 titled "Arbitrary Literal String Type" just got accepted.
nan
0.92
t3_tjx689
1,647,932,830
Python
How to be a Successful Python developer: Tips to help your hiring prospects
nan
0.1
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.29
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.79
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.99
t3_tjlv0x
1,647,896,295
Python
What is the difference between PyInstaller and PyOxydizer?
nan
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.71
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.78
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
nan
0.63
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.6
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.65
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
nan
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?
nan
0.4
t3_tjb86q
1,647,867,437
Python
Daily dose of Python
I've been creating small posts about slightly more advanced Python topics lately. They are all available in [https://jerry-git.github.io/daily-dose-of-python/](https://jerry-git.github.io/daily-dose-of-python/). The episodes so far: 1. [Union vs TypeVar](https://jerry-git.github.io/daily-dose-of-python/doses/1/) 2. [contextmanager from contextlib](https://jerry-git.github.io/daily-dose-of-python/doses/2/) 3. [Modern Python web stack](https://jerry-git.github.io/daily-dose-of-python/doses/3/) 4. [Exhaustiveness checking with mypy](https://jerry-git.github.io/daily-dose-of-python/doses/4/) 5. [PEP 673 Self Type](https://jerry-git.github.io/daily-dose-of-python/doses/5/) 6. [Final qualifier](https://jerry-git.github.io/daily-dose-of-python/doses/6/) 7. [apischema](https://jerry-git.github.io/daily-dose-of-python/doses/7/) 8. [Static duck typing via Protocol](https://jerry-git.github.io/daily-dose-of-python/doses/8/) 9. [dirty-equals](https://jerry-git.github.io/daily-dose-of-python/doses/9/) And countless more to come 😉 The site itself is mkdocs based static website which is hosted as GitHub pages. Here's the [GitHub repo](https://github.com/jerry-git/daily-dose-of-python).
0.97
t3_tj9tz1
1,647,862,900
Python
How to Deploy a TensorFlow Model as a RESTful API Service
nan
0.83
t3_tj8uzz
1,647,859,275
Python
oneFace: Generating interfaces(CLI, Qt GUI, Dash web app) from a Python function.
oneFace can generate CLI, Qt GUI and Dash web app at the same time from a Python function. Just mark the function parameters with type and range, for example: from oneface import one, Arg @one def bmi(name: Arg(str), height: Arg(float, [100, 250]) = 160, weight: Arg(float, [0, 300]) = 50.0): BMI = weight / (height / 100) ** 2 print(f"Hi {name}. Your BMI is: {BMI}") return BMI # run cli bmi.cli() # or run qt_gui bmi.qt_gui() # or run dash web app bmi.dash_app() These code will generate the following interfaces: [CLI](https://preview.redd.it/nrgkxp68cpo81.png?width=536&format=png&auto=webp&s=58c872f37c513fc5d2dd120e77065795479455a8) ​ [Qt GUI](https://preview.redd.it/c5xrs7lccpo81.png?width=212&format=png&auto=webp&s=5fce4feaa5bec5298e35df574a50b3b72904da64) ​ [Dash web app](https://preview.redd.it/nxylugpdcpo81.png?width=610&format=png&auto=webp&s=8df8d72bc95c151caba500c532257c33dfcd0d4e) ## Other features * Automatically check the type and range of input parameters and pretty print them. * Easy extension of parameter types and GUI widgets. ## Application and Limitations Provides interfaces to programs in a very simple way. For example converting functions directly into a web apps for people who don't know how to use the command line. The limitation is that it is only suitable for creating simple interfaces. ## Links * Repo: [https://github.com/Nanguage/oneFace](https://github.com/Nanguage/oneFace) * Documentation: [https://oneface.readthedocs.io/en/latest/](https://oneface.readthedocs.io/en/latest/) ## Similar Projects * [Fire](https://github.com/google/python-fire): Generate CLI from Python objects. * [Gooey](https://github.com/chriskiehl/Gooey): Turn (almost) any Python 3 Console Program into a GUI application with one line.
0.9
t3_tj7d1w
1,647,853,109
Python
Performance testing FastAPI ML APIs with Locust | Rubik's Code
nan
0.76
t3_tj6v1x
1,647,850,944
Python
Why venv?
I'm new to Python and haven't worked with virtual environments before. I've seen a lot of folks utilising venv and was confused. I searched the web, but I couldn't comprehend much of it. I have a question that I'd want every one of you to answer. 1. Why venv?
0.83
t3_tj32vd
1,647,835,530
Python
Codecat
CodeCat is an open-source tool to help you find/track user input sinks and security bugs using static code analysis. These points follow regex rules. [https://github.com/CoolerVoid/codecat](https://github.com/CoolerVoid/codecat)
0.76
t3_tj2g24
1,647,833,363
Python
LinkedIn Researchers Open-Source ‘FastTreeSHAP’: A Python Package That Enables An Efficient Interpretation of Tree-Based Machine Learning Models
Researchers from LinkedIn open-source the FastTreeSHAP package which is a Python module based on the paper ‘[Fast TreeSHAP: Accelerating SHAP Value Computation for Trees](https://arxiv.org/abs/2109.09847).’ Implementing the widely-used TreeSHAP algorithm in the SHAP package allows for the efficient interpretation of tree-based machine learning models by estimating sample-level feature significance values. Its package includes two new algorithms: FastTreeSHAP v1 and FastTreeSHAP v2, both of which improve TreeSHAP’s computational efficiency by taking a different approach.  The empirical benchmarking tests show that FastTreeSHAP v1 is 1.5x faster than TreeSHAP while keeping memory costs the same, and FastTreeSHAP v2 is 2.5x faster while using slightly more memory. The FastTreeSHAP package fully supports parallel multi-core computing to speed up its computation. [**Continue Reading The Full Summary Article**](https://www.marktechpost.com/2022/03/20/linkedin-researchers-open-source-fasttreeshap-a-python-package-that-enables-an-efficient-interpretation-of-tree-based-machine-learning-models/) Paper: https://arxiv.org/pdf/2109.09847.pdf Github: https://github.com/linkedin/fasttreeshap
0.76
t3_tj1koz
1,647,830,519
Python
I created a self-hosted security camera system
I don't like the idea of having to stream my video camera feeds to the cloud, so I created a privacy-focused, self-hosted security camera system using python! [https://github.com/scottbarnesg/smart-sec-cam](https://github.com/scottbarnesg/smart-sec-cam) Some key features: * Multi-camera support w/ minimal configuration. Supports USB cameras and the Raspberry Pi camera module. * Motion detection that automatically saves videos and lets you view them in the web app. * Encrypted in transit, both from the cameras to the server and the server to your browser. * Self-hosted and FOSS
0.96
t3_tizhpw
1,647,823,860
Python
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.
0.71
t3_tiyhw1
1,647,820,810
Python
Live Python Course from computer science professor on Cyber Insecurity Youtube Channel
If anyone wants to learn Python from a professor who's been teaching computer science for over a decade, jump on the Cyber Insecurity Youtube channel on Tuesday nights at 8PM ET. [https://www.youtube.com/channel/UCL4JGzitDkX5TOwzs9A02Kg](https://www.youtube.com/channel/UCL4JGzitDkX5TOwzs9A02Kg)
0.83
t3_tixven
1,647,818,906
Python
The LAST 20 Python Packages you will ever need (Machine Learning, Data S...
nan
0.14
t3_tith9h
1,647,806,495
Python
EZTV-AutoDownloader / Transmission Manager
Hello! (I don't know if this is for this sub.) I made Auto Downloader from EZTV and Transmission-Remote Manager written in Python. Some features: * Automatic download from EZTV * Check Episode and Season to see if ep is newer * Remove torrent from Transmission if Completed * Email notifications on add and complete. If you're interested, go to the git repo for more information https://github.com/xhico/EZTV-AutoDownloader Thanks!
0.83
t3_tiqz2t
1,647,799,587
Python
MD now avaible on Termux
A while ago I made a text based tool to download music in mp3 with tags and artworks. Now it's available on Termux. Cheers! [https://github.com/eliamazzon/MusicDownloader](https://github.com/eliamazzon/MusicDownloader)
0.83
t3_tiqdvp
1,647,798,001
Python
Looking for an official documentation regarding security best practices and how to write secure code
I am looking for resources on how to write secure code with Python, I have been in python.org but there is only a Security reporting section. Before considering Google top results I would like to check if there is an official documentation
0.94
t3_tiq3ts
1,647,797,237
Python
tkthread - Easy multithreading with tkinter
nan
0.7
t3_tip8va
1,647,794,947
Python
I just started python 10 days ago an I am super happy. I just created my first program and would love some feedback
I am a complete programming beginner. I started a course on Udemy 10 days ago and this is my first program. I know it is probably not the most efficient way to do it which is why I would like your feedback. here is the Github link: [https://github.com/RVP97/TicTacToe/blob/main/Project1](https://github.com/RVP97/TicTacToe/blob/main/Project1) `f_top= ' | | '` `f_mid= ' 1 | 2 | 3 '` `f_low= '_____|_______|____'` `s_top= ' | | '` `s_mid= ' 4 | 5 | 6 '` `s_low= '_____|_______|____'` `t_top= ' | | '` `t_mid= ' 7 | 8 | 9 '` `t_low= ' | | '` ​ `f_top_1= ' | | '` `f_mid_1= ' | | '` `f_low_1= '_____|_______|____'` `s_top_1= ' | | '` `s_mid_1= ' | | '` `s_low_1= '_____|_______|____'` `t_top_1= ' | | '` `t_mid_1= ' | | '` `t_low_1= ' | | '` ​ `def print_options():` `print(f_top)` `print(f_mid)` `print(f_low)` `print(s_top)` `print(s_mid)` `print(s_low)` `print(t_top)` `print(t_mid)` `print(t_low)` `def print_game():` `print(f_top_1)` `print(f_mid_1)` `print(f_low_1)` `print(s_top_1)` `print(s_mid_1)` `print(s_low_1)` `print(t_top_1)` `print(t_mid_1)` `print(t_low_1)` `def print_every():` `print('OPTIONS')` `print_options()` `print('')` `print('GAME')` `print_game()` `print('Hello players. We are going to play a round of Tic Tac Toe!')` ​ `def player_one_name():` `player_one=input("What is player one's name?: ")` `return player_one` ​ `def player_two_name():` `player_two=input("What is player two's name?: ")` `return player_two` ​ `player_one=player_one_name()` ​ `player_two=player_two_name()` ​ `print(f"It is time for {player_one} to play against {player_two}")` ​ `import random` ​ `list = [player_one,player_two]` `rand = random.choice(list)` `print(f"It is {rand}'s turn")` `if rand == player_one:` `other=player_two` `else:` `other=player_one` ​ ​ `from IPython.display import clear_output` `print_options()` `option_list= ['1','2','3','4','5','6','7','8','9']` `condition=True` `while condition:` `while True:` `if (f_mid_1[2]=='O' and f_mid_1[9]=='O' and f_mid_1[16]=='O') or (s_mid_1[2]=='O' and s_mid_1[9]=='O' and s_mid_1[16]=='O') or (t_mid_1[2]=='O' and t_mid_1[9]=='O' and t_mid_1[16]=='O') or (f_mid_1[2]=='O' and s_mid_1[2]=='O' and t_mid_1[2]=='O') or(f_mid_1[9]=='O' and s_mid_1[9]=='O' and t_mid_1[9]=='O') or (f_mid_1[16]=='O' and s_mid_1[16]=='O' and t_mid_1[16]=='O') or (f_mid_1[2]=='O' and s_mid_1[9]=='O' and t_mid_1[16]=='O') or (f_mid_1[16]=='O' and s_mid_1[9]=='O' and t_mid_1[2]=='O'):` `print(f'{other} wins')` `condition=False` `break` `if (f_mid_1[2]=='X' and f_mid_1[9]=='X' and f_mid_1[16]=='X') or (s_mid_1[2]=='X' and s_mid_1[9]=='X' and s_mid_1[16]=='X') or (t_mid_1[2]=='X' and t_mid_1[9]=='X' and t_mid_1[16]=='X') or (f_mid_1[2]=='X' and s_mid_1[2]=='X' and t_mid_1[2]=='X') or(f_mid_1[9]=='X' and s_mid_1[9]=='X' and t_mid_1[9]=='X') or (f_mid_1[16]=='X' and s_mid_1[16]=='X' and t_mid_1[16]=='X') or (f_mid_1[2]=='X' and s_mid_1[9]=='X' and t_mid_1[16]=='X') or (f_mid_1[16]=='X' and s_mid_1[9]=='X' and t_mid_1[2]=='X'):` `print(f'{rand} wins')` `condition=False` `break` `if len(option_list)==0:` `print("It's a tie")` `condition=False` `break` ​ `player_choice=input(f'{rand}, pick a number between 1 and 9: ')` `if player_choice in option_list:` `player_choice = int(player_choice)` `if player_choice == 1:` `clear_output()` `f_mid_1 = f_mid_1[:2] + 'X' + f_mid_1[2+1:]` `option_list.remove('1')` `print_every()` `break` `if player_choice == 2:` `clear_output()` `f_mid_1 = f_mid_1[:9] + 'X' + f_mid_1[9+1:]` `option_list.remove('2')` `print_every()` `break` `if player_choice == 3:` `clear_output()` `f_mid_1 = f_mid_1[:16] + 'X' + f_mid_1[16+1:]` `option_list.remove('3')` `print_every()` `break` ​ `if player_choice == 4:` `clear_output()` `s_mid_1 = s_mid_1[:2] + 'X' + s_mid_1[2+1:]` `option_list.remove('4')` `print_every()` `break` ​ `if player_choice == 5:` `clear_output()` `s_mid_1 = s_mid_1[:9] + 'X' + s_mid_1[9+1:]` `option_list.remove('5')` `print_every()` `break` ​ `if player_choice == 6:` `clear_output()` `s_mid_1 = s_mid_1[:16] + 'X' + s_mid_1[16+1:]` `option_list.remove('6')` `print_every()` `break` ​ `if player_choice == 7:` `clear_output()` `t_mid_1 = t_mid_1[:2] + 'X' + t_mid_1[2+1:]` `option_list.remove('7')` `print_every()` `break` ​ `if player_choice == 8:` `clear_output()` `t_mid_1 = t_mid_1[:9] + 'X' + t_mid_1[9+1:]` `option_list.remove('8')` `print_every()` `break` ​ `if player_choice == 9:` `clear_output()` `t_mid_1 = t_mid_1[:16] + 'X' + t_mid_1[16+1:]` `option_list.remove('9')` `print_every()` `break` `else:` `clear_output()` `print('Pick a valid number or a position that has not been picked before')` `print_every()` `continue` `while True:` `if (f_mid_1[2]=='O' and f_mid_1[9]=='O' and f_mid_1[16]=='O') or (s_mid_1[2]=='O' and s_mid_1[9]=='O' and s_mid_1[16]=='O') or (t_mid_1[2]=='O' and t_mid_1[9]=='O' and t_mid_1[16]=='O') or (f_mid_1[2]=='O' and s_mid_1[2]=='O' and t_mid_1[2]=='O') or(f_mid_1[9]=='O' and s_mid_1[9]=='O' and t_mid_1[9]=='O') or (f_mid_1[16]=='O' and s_mid_1[16]=='O' and t_mid_1[16]=='O') or (f_mid_1[2]=='O' and s_mid_1[9]=='O' and t_mid_1[16]=='O') or (f_mid_1[16]=='O' and s_mid_1[9]=='O' and t_mid_1[2]=='O'):` `condition=False` `break` `if (f_mid_1[2]=='X' and f_mid_1[9]=='X' and f_mid_1[16]=='X') or (s_mid_1[2]=='X' and s_mid_1[9]=='X' and s_mid_1[16]=='X') or (t_mid_1[2]=='X' and t_mid_1[9]=='X' and t_mid_1[16]=='X') or (f_mid_1[2]=='X' and s_mid_1[2]=='X' and t_mid_1[2]=='X') or(f_mid_1[9]=='X' and s_mid_1[9]=='X' and t_mid_1[9]=='X') or (f_mid_1[16]=='X' and s_mid_1[16]=='X' and t_mid_1[16]=='X') or (f_mid_1[2]=='X' and s_mid_1[9]=='X' and t_mid_1[16]=='X') or (f_mid_1[16]=='X' and s_mid_1[9]=='X' and t_mid_1[2]=='X'):` `print(f'{rand} wins')` `condition=False` `break` `if len(option_list)==0:` `print("It's a tie")` `condition=False` `break` ​ `player_choice=input(f'{other}, pick a number between 1 and 9: ')` `if player_choice in option_list:` `player_choice = int(player_choice)` `if player_choice == 1:` `clear_output()` `f_mid_1 = f_mid_1[:2] + 'O' + f_mid_1[2+1:]` `option_list.remove('1')` `print_every()` `break` `if player_choice == 2:` `clear_output()` `f_mid_1 = f_mid_1[:9] + 'O' + f_mid_1[9+1:]` `option_list.remove('2')` `print_every()` `break` `if player_choice == 3:` `clear_output()` `f_mid_1 = f_mid_1[:16] + 'O' + f_mid_1[16+1:]` `option_list.remove('3')` `print_every()` `break` ​ `if player_choice == 4:` `clear_output()` `s_mid_1 = s_mid_1[:2] + 'O' + s_mid_1[2+1:]` `option_list.remove('4')` `print_every()` `break` ​ `if player_choice == 5:` `clear_output()` `s_mid_1 = s_mid_1[:9] + 'O' + s_mid_1[9+1:]` `option_list.remove('5')` `print_every()` `break` ​ `if player_choice == 6:` `clear_output()` `s_mid_1 = s_mid_1[:16] + 'O' + s_mid_1[16+1:]` `option_list.remove('6')` `print_every()` `break` ​ `if player_choice == 7:` `clear_output()` `t_mid_1 = t_mid_1[:2] + 'O' + t_mid_1[2+1:]` `option_list.remove('7')` `print_every()` `break` ​ `if player_choice == 8:` `clear_output()` `t_mid_1 = t_mid_1[:9] + 'O' + t_mid_1[9+1:]` `option_list.remove('8')` `print_every()` `break` ​ `if player_choice == 9:` `clear_output()` `t_mid_1 = t_mid_1[:16] + 'O' + t_mid_1[16+1:]` `option_list.remove('9')` `print_every()` `break` `else:` `clear_output()` `print('Pick a valid number or a position that has not been picked before')` `print_every()` `continue`
0.43
t3_tiox8d
1,647,794,055
Python
I made a video tutorial on how to work with image data with python. Hope its a helpful introduction for anyone interested in learning about image processing.
nan
0.89
t3_tinykr
1,647,791,398
Python
Sending Emails With Python
nan
0.5
t3_tin22d
1,647,788,786
Python
pip install medium-api
Hi Guys, I recently published a python wrapper around [Medium API](https://rapidapi.com/nishujain199719-vgIfuFHZxVZ/api/medium2) which helps you to extract/fetch data from [medium.com](https://medium.com). To install it, just run: ``` pip install medium-api ``` **What can you extract with it?** - Medium User information and user-written articles - Medium Articles information and their textual content - Medium Publications information - Medium’s Top Writers - Medium’s Topfeeds (Trending, Latest, All time best, best of year/month/week) - Medium’s Latest Posts (distributed articles) **How to use it?** ```python from medium_api import Medium medium = Medium('YOUR_RAPIDAPI_KEY') user = medium.user(username='nishu-jain') user.fetch_articles() for article in user.articles: print(article.title) ``` **A few references:** - Github repository: https://github.com/weeping-angel/medium-api - Website: https://mediumapi.com - Swagger documentation: https://docs.mediumapi.com - ReadTheDocs: https://medium-api.readthedocs.io/en/latest/ - PyPI: https://pypi.org/project/medium-api/ Hoping someone will find it useful :)
0.82
t3_timph1
1,647,787,819
Python
Python Collection Classes - Queues, NamedTuples, DefaultDict, the Professor and Mary Ann
[https://codesolid.com/useful-collection-classes-in-python-you-may-not-know/](https://codesolid.com/useful-collection-classes-in-python-you-may-not-know/) Enjoy!
1
t3_tilukh
1,647,785,280
Python
Creating Real-Time Charts with FastAPI
https://github.com/roniemartinez/real-time-charts-with-fastapi I've made sample application for anyone interested in writing real-time charts with FastAPI + Server-Sent Events. You can check my Github repo above.
0.83
t3_tilg4d
1,647,784,101
Python
Create A REST API In Python Flask
nan
0.4
t3_tikn0t
1,647,781,534
Python
Step by Step Procedure to Deploy A Flask App On Heroku
nan
0.17
t3_tikmj3
1,647,781,487
Python
Python Flask, ElasticSearch and docker environment
Hi, the second article devoted to the theme: “How to work with ElasticSearch using Python and Flask framework” is already ready for reading. It is about preparing microservice environment using docker and docker compose. All details are here: "[Python Flask, ElasticSearch and Docker environment](https://sergiiblog.com/python-flask-elasticsearch-and-docker-environment/)". Have a pleasant reading.
0.76
t3_tiid1f
1,647,772,934
Python
Gufo Loader
[Gufo Loader](https://github.com/gufolabs/gufo_loader) is the flexible Python plugin infrastructure framework. We'd used this approach in the [NOC](https://getnoc.com/) \- an open-source network management system and finally decided to release this component as the independent package. Very useful tool to build extendable and reliable python applications and services.
0.75
t3_tihlqu
1,647,769,687
Python
How to make the most of Pydantic
nan
0.84
t3_tih4e7
1,647,767,586
Python
Sudoku Solver Using Python | AI projects
Github: [https://github.com/bhimrazy/Artificial-Intelligence-Projects](https://github.com/bhimrazy/Artificial-Intelligence-Projects) https://preview.redd.it/xswtp52b3ho81.png?width=1097&format=png&auto=webp&s=8ce31043a6238eb74bddc97ff6dc6b4072f82f38
0.86
t3_tidx7v
1,647,753,441
Python
I Wanted to Make a Game from Scratch (visuals and all) Using Python so I did.
​ [https:\/\/github.com\/M0pps\/Dinosaur-Game.git](https://reddit.com/link/tid126/video/pvim4rectgo81/player)
0.97
t3_tid126
1,647,750,072
Python
Creating a DCGAN with PyTorch
I wrote a short tutorial on creating a deep convolutional GAN to generate new wild animals images from the wildlife animal faces dataset using PyTorch: [https://taying-cheng.medium.com/create-new-animals-using-dcgan-with-pytorch-2ce47810ebd4](https://taying-cheng.medium.com/create-new-animals-using-dcgan-with-pytorch-2ce47810ebd4)
0.67
t3_ti9u5w
1,647,738,961
Python
Modularizing a Chalice Application
If you're looking to develop Chalice lambda functions and needing to realistically modularize your application and files, here's a pretty good article (I'm not the author) on how to go about that. Chalice is used for AWS lambda function development and deployment and has routing decorators similar to Flask and other APIs framework. [https://medium.com/tensoriot/modularizing-a-chalice-application-for-teams-f716f496b94b](https://medium.com/tensoriot/modularizing-a-chalice-application-for-teams-f716f496b94b)
0.5
t3_ti9ryn
1,647,738,759
Python
Space Science with Python - AI 1-8: A Dense Neural Network
Hey Python coders, today I would like to show you a new tutorial video within my Space Science with Python series. I am still working on a Machine Learning project, and this time we will use TensorFlow / Keras to create a multi-class classifier for our asteroids reflectance spectra. Since our spectra data are already perfectly cleaned and processed, even a simple Dense layer architecture provides fair results; you'll see! And for starters, Dense-layer-based networks are easy to "digest". The next video will consider convolution networks and afterwards you will see some nice Autoencoder architecture and unsupervised classification methods. Hopefully you'll like it! Anyway. A word of "warning". When I create my tutorials I prepare my code, test it, format it, test it again etc. Also this time. But: I had some functions in the Google Colab cache. My "new" functions were not called correctly and I figured it out in the last minutes! Anyway, I left it in the video for others to learn from my mistake I made there. Please note: reset your runtime when you start something new and be aware of issues when using Notebooks in a productive environment. GitHub: [https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/%5BML1%5D-Asteroid-Spectra/8\_dl\_dense\_multiclass.ipynb](https://github.com/ThomasAlbin/Astroniz-YT-Tutorials/blob/main/%5BML1%5D-Asteroid-Spectra/8_dl_dense_multiclass.ipynb) YouTube: [https://youtu.be/O0rQswBZJ7o](https://youtu.be/O0rQswBZJ7o) Cheers, Thomas
0.81
t3_ti90ps
1,647,736,289
Python
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.
1
t3_ti8esn
1,647,734,409
Python
I teach python for middle and high schoolers – I made this little trophy for a competition of who could make the best image using Turtle/Python
I will also make some keychains with the best images 3d-printed on them – I hope the students like them! ​ https://i.redd.it/7cyldg3odfo81.gif
0.97
t3_ti7uyh
1,647,732,704
Python
Automate Key board and mouse
see a lot of people probably using this for gaming but can be used for your job. I use this type of stuff to auto mate stuff I have to type over and over then click a bunch of bottons. Hope it helps ​ [https://www.youtube.com/watch?v=shi5Ba\_y4HA&t=264s](https://www.youtube.com/watch?v=shi5Ba_y4HA&t=264s) ​ Has anyone used Python to automate other stuff. I want to expand on automating on Python. Or know good modules for stuff like that?
0.92
t3_ti5hm4
1,647,725,723
Python
New Python package for stock market data: YFrake
I've released a new open-source Python package named [YFrake (Github Repository)](https://github.com/aspenforest/yfrake), which returns stock market data from Yahoo Finance and can also serve it to other applications. It has built-in swagger documentation and can run in async and threaded modes. More features are planned for future releases. Package documentation is available at [yfrake.readthedocs.io](http://yfrake.readthedocs.io/) .
0.71
t3_ti5geq
1,647,725,628