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
so im 30 switching careers from automotive to computers started college for computer science learning python 3 but i feel its going kinda slow learning so much though so i figured I would ask the more knowledgeable people on what i can do in my free time to grow my knowledge more
0.67
t3_tz7tcm
1,649,436,416
Python
Preferred way to connect to a database
Is it a particular ORM, do you use a particular ODBC library, embracing the bleeding edge of speed with Apache Arrow? What satisfies your data source access needs and why?
0.78
t3_tz7aj5
1,649,434,965
Python
Unix Command Cheat Sheet for Busy Developers
0.69
t3_tz62m7
1,649,431,679
Python
Scrape Google Play Search Apps in Python
Hey guys, just in case anyone wants to scrape Google Play Store App Search 👀 Full code: ```python from bs4 import BeautifulSoup from serpapi import GoogleSearch import requests, json, lxml, re, os def bs4_scrape_all_google_play_store_search_apps( query: str, filter_by: str = "apps", country: str = "US"): # https://docs.python-requests.org/en/master/user/quickstart/#passing-parameters-in-urls params = { "q": query, # search query "gl": country, # country of the search. Different country display different apps. "c": filter_by # filter to display list of apps. Other filters: apps, books, movies } # https://docs.python-requests.org/en/master/user/quickstart/#custom-headers headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.79 Safari/537.36", } html = requests.get("https://play.google.com/store/search", params=params, headers=headers, timeout=30) soup = BeautifulSoup(html.text, "lxml") apps_data = [] for app in soup.select(".mpg5gc"): title = app.select_one(".nnK0zc").text company = app.select_one(".b8cIId.KoLSrc").text description = app.select_one(".b8cIId.f5NCO a").text app_link = f'https://play.google.com{app.select_one(".b8cIId.Q9MA7b a")["href"]}' developer_link = f'https://play.google.com{app.select_one(".b8cIId.KoLSrc a")["href"]}' app_id = app.select_one(".b8cIId a")["href"].split("id=")[1] developer_id = app.select_one(".b8cIId.KoLSrc a")["href"].split("id=")[1] try: # https://regex101.com/r/SZLPRp/1 rating = re.search(r"\d{1}\.\d{1}", app.select_one(".pf5lIe div[role=img]")["aria-label"]).group() except: rating = None thumbnail = app.select_one(".yNWQ8e img")["data-src"] apps_data.append({ "title": title, "company": company, "description": description, "rating": float(rating) if rating else rating, # float if rating is not None else rating or None "app_link": app_link, "developer_link": developer_link, "app_id": app_id, "developer_id": developer_id, "thumbnail": thumbnail }) print(json.dumps(apps_data, indent=2, ensure_ascii=False)) bs4_scrape_all_google_play_store_search_apps(query="maps", filter_by="apps", country="US") def serpapi_scrape_all_google_play_store_apps(): params = { "api_key": os.getenv("API_KEY"), # your serpapi api key "engine": "google_play", # search engine "hl": "en", # language "store": "apps", # apps search "gl": "us", # contry to search from. Different country displays different. "q": "maps" # search qeury } search = GoogleSearch(params) # where data extracts results = search.get_dict() # JSON -> Python dictionary apps_data = [] for apps in results["organic_results"]: for app in apps["items"]: apps_data.append({ "title": app.get("title"), "link": app.get("link"), "description": app.get("description"), "product_id": app.get("product_id"), "rating": app.get("rating"), "thumbnail": app.get("thumbnail"), }) print(json.dumps(apps_data, indent=2, ensure_ascii=False)) ``` Output from DIY solution: ```json [ { "title": "Google Maps", "company": "Google LLC", "description": "Real-time GPS navigation & local suggestions for food, events, & activities", "rating": 3.9, "app_link": "https://play.google.com/store/apps/details?id=com.google.android.apps.maps", "developer_link": "https://play.google.com/store/apps/dev?id=5700313618786177705", "app_id": "com.google.android.apps.maps", "developer_id": "5700313618786177705", "thumbnail": "https://play-lh.googleusercontent.com/Kf8WTct65hFJxBUDm5E-EpYsiDoLQiGGbnuyP6HBNax43YShXti9THPon1YKB6zPYpA=s128-rw" }, { "title": "Google Maps Go", "company": "Google LLC", "description": "Get real-time traffic, directions, search and find places", "rating": 4.3, "app_link": "https://play.google.com/store/apps/details?id=com.google.android.apps.mapslite", "developer_link": "https://play.google.com/store/apps/dev?id=5700313618786177705", "app_id": "com.google.android.apps.mapslite", "developer_id": "5700313618786177705", "thumbnail": "https://play-lh.googleusercontent.com/0uRNRSe4iS6nhvfbBcoScHcBTx1PMmxkCx8rrEsI2UQcQeZ5ByKz8fkhwRqR3vttOg=s128-rw" }, { "title": "Waze - GPS, Maps, Traffic Alerts & Live Navigation", "company": "Waze", "description": "Save time on every drive. Waze tells you about traffic, police, crashes & more", "rating": 4.4, "app_link": "https://play.google.com/store/apps/details?id=com.waze", "developer_link": "https://play.google.com/store/apps/developer?id=Waze", "app_id": "com.waze", "developer_id": "Waze", "thumbnail": "https://play-lh.googleusercontent.com/muSOyE55_Ra26XXx2IiGYqXduq7RchMhosFlWGc7wCS4I1iQXb7BAnnjEYzqcUYa5oo=s128-rw" }, ... other results ] ``` Full blog post with step-by-step explanation: https://serpapi.com/blog/scrape-google-play-search-apps-in-python/
0.78
t3_tz621l
1,649,431,634
Python
Rock-Paper-Scissors-Lizard-Spock Game
from random import randint # create a list of play options options = ["Rock", "Paper", "Scissors", "Lizard", "Spock"] play = True while play == True: computer = options[randint(0, 4)] user_input = input("Please select; Rock, Paper, Scissors, Lizard or Spock\n") u = user_input.lower() player = u.capitalize() print("Player: ", player) print("Computer: ", computer) ##Tie if player == computer: print("Tie!") ##Rock elif player =="Rock": if computer == "Paper": print("You lose!", computer, "covers", player) elif computer == "Scissors": print("You win!", player, "smashes", computer) elif computer == "Lizard": print("You win!", player, "crushes", computer) elif computer == "Spock": print("You lose!", computer, "vaporizes", player) ##Paper elif player =="Paper": if computer == "Scissors": print("You lose!", computer, "cuts", player) elif computer =="Rock": print("You win!", player, "covers", computer) elif computer == "Lizard": print("You lose!", computer , "eats", player) elif computer == "Spock": print("You win!", player, "disproves", computer) ##Scissors elif player == "Scissors": if computer == "Paper": print("You win!", player, "cuts", computer) elif computer == "Rock": print("You lose!", computer, "crushes", player) elif computer =="Lizard": print("You win!", player, "decapitates", computer) elif computer == "Spock": print("You lose!", computer, "smashes", player) ##Lizard elif player == "Lizard": if computer =="Rock": print("You lose!", computer, "crushes", player) elif computer =="Paper": print("You win!", player, "eats", computer) elif computer == "Scissors": print("You lose!", computer, "decapitates", player) elif computer == "Spock": print("You win!", player, "", computer) ##Spock elif player == "Spock": if computer == "Rock": print("You win!", player, "vaporizes", computer) elif computer == "Paper": print("You lose!", computer, "disproves", player) elif computer == "Scissors": print("You win!", player, "smashes", computer) elif computer == "Lizard": print("You lose!", computer, "poisons", player) print("Would you like to play again? \n") answer =input() if answer.lower() =="y" or answer.lower() =="yes": play == True else: break ​ ​ This is a game I made a while back, link; [https://github.com/WillPhillipsCVdemo/Rock-Paper-Scissors-Lizard-Spock/blob/master/Game.py](https://github.com/WillPhillipsCVdemo/Rock-Paper-Scissors-Lizard-Spock/blob/master/Game.py)
0.74
t3_tz41db
1,649,425,971
Python
MicroPython pro-tip: Use WebREPL within your IDE
The repetitive process of editing your code in Thonny IDE, switching over to the WebREPL window, re-selecting your edited code file, re-sending it to your ESP32, and going back to Thonny to fix any bugs can get cumbersome and slow. Here's a visual tutorial on how to use WebREPL within Thonny. Hope it helps you! [https://bhave.sh/micropython-webrepl-thonny/](https://bhave.sh/micropython-webrepl-thonny/)
0.5
t3_tz3knl
1,649,424,548
Python
br4nch 2.0 - Currently in development!
After recieving alot of helpful feedback and feature requests, I have decided to start the development of version 2.0 for br4nch! *Please visit:* [*https://br4nch.com*](https://br4nch.com) *for helpful links.* ​ **Here are some of the upcoming features:** * Renewing alot of arguments and crucial functions. ⚠️ * Adding a new 'load.json' function that imports a complete json data file. * Adding a new 'export.json' function that exports a branch to a json data file. * Adding a new 'list.branches' function. * Adding a new 'list.nodes' function. * Adding an improved algorithm to search for new updates for br4nch. * Adding support for more python versions. * Updating documentation. * Rewritting alot of other functions. # 💙💛
0.6
t3_tz38cy
1,649,423,481
Python
Favorite Python Web Framework
Django FastAPI Flask Masonite Bottle …other? Also discuss why
0.93
t3_tz2v7b
1,649,422,377
Python
Does clean code equal "Workplace" code
I am a beginner at python and have been following Angela Yu's 100 days of python. I commented on a post regarding my Coffee Machine code been some 400 lines while hers was around 150 lines with the same functionilty. ​ This led me to ask this question of, if code works does it matter if it's clean and pythonic. ​ I will reference these two tic toe games below: ​ 18000 lines (no adherence to DRY but simple to understand) [https://github.com/asweigart/my\_first\_tic\_tac\_toe/blob/9f38b04e857426c5a5b80919ad0b5fce0947c022/tictactoe.py](https://github.com/asweigart/my_first_tic_tac_toe/blob/9f38b04e857426c5a5b80919ad0b5fce0947c022/tictactoe.py) ​ 1 line (I was shocked that such a thing was even possible, considering my tic tac toe code was around 500 lines with no AI. This code is in my opinion way way to complex and one would probably be working in the realm of datasciences/ML to understand such a thing) [https://www.reddit.com/r/Python/comments/9ozfeq/tictactoe\_in\_one\_line\_python35/](https://www.reddit.com/r/Python/comments/9ozfeq/tictactoe_in_one_line_python35/) ​ Both programs work, but if one was given only the option of picking from the two, which would be preffered in the workplace? In my opinion, the 18000 line code would be acceptable as it allows all team members, novice or not to atleast have some understanding. ​ EDIT: Better late than never, but I realised I have been referencing my tic tac toe code of 500 lines vs the 1 and 18000 liners but havent posted it for comparison. So here it is (I do acknowledge that a tic tac toe game has no relevance to the workplace, but is the code structure I used somewhere along the lines of "hirable".): [https://pastebin.com/GBCRiGWe](https://pastebin.com/GBCRiGWe)
0.5
t3_tyztcm
1,649,410,916
Python
Creating 3D Maps with Python (feat.Mapbox)
**Creating 3D Maps with Python (feat.Mapbox)** [https://wooiljeong.github.io/python/mapboxgl\_map/](https://wooiljeong.github.io/python/mapboxgl_map/) Using WGL provided by Mapbox with Python, I visualized apartment prices in Seoul, Korea on a 3D map. The description of the implementation method is in Korean, but the code is also recorded, so there is no difficulty in understanding it. https://preview.redd.it/qcnyr389t9s81.png?width=919&format=png&auto=webp&s=d9e1997e4f95119926a04aaa09492a11a3c2be60
0.57
t3_tyzbab
1,649,408,660
Python
Backgammon Game
A game of backgammon. Written with Python and Cython. I'm interested in artificial intelligence so this program has an ai and can play against itself. It uses the monte-carlo tree search algorithm. https://preview.redd.it/xhkqm66ej8s81.png?width=802&format=png&auto=webp&s=60007f6b59c5471f70b98234be65aa6a9201a551 [https://github.com/Tracing/python-backgammon](https://github.com/Tracing/python-backgammon)
0.67
t3_tyvodx
1,649,393,370
Python
Best 20 Python Program only for Beginners
The Python programming language is one of the most used languages in the world, especially in data analytics. There are many different types of Python projects that you can do. Some of the most common Python project ideas are listed in this blog. Source Code: [https://www.myguideinfo.com/search/label/python-projects](https://www.myguideinfo.com/search/label/python-projects) **The 20 Best Python Projects only for Beginners** 1. Finding Mean, Median, Mode in Python without libraries 2. Program to Find LCM of two numbers in Python 3. Find Duplicate Values using Python 4. Python Program to Check Prime Number 5. Find Greater Number Using If Function In Python 6. Taking Multiple User's Input Using While Loop in Python 7. Create a Digital Clock In Python With Source Code 8. Create To-Do List Using Python with Source Code 9. Python Program to Display Calendar with Source Code 10. Create a Password Generator In Python with Source Code 11. Python Program to Print all Prime Numbers in an Interval 12. Python Program to Find the Sum of Natural Numbers 13. Python Program to Find the Factorial of a Number 14. Calculate the Area of a Triangle in Python 15. Python Program to Create a Countdown Timer 16. Python Program to add two Matrices, Transpose, and Multiply 17. Contact Management Project In Python With Source Code 18. Billing System Project In Python With Source Code 19. Vehicle Inventory System In Python With Source Code 20. Library Management System In Python with Source Code Source Code: [https://www.myguideinfo.com/search/label/python-projects](https://www.myguideinfo.com/search/label/python-projects)
0.45
t3_tyvlpg
1,649,393,079
Python
I'm 13, trying to learn Python.
Where/what do you think I should start, learn first, or do you just have any tips? Also, make sure what ever you're suggesting is free. Please.
0.79
t3_tyu7kl
1,649,388,175
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!
0.88
t3_tyqfk8
1,649,376,010
Python
With the very little Python experience I have, I coded this little “game” of uno.
[link to the python code](https://www.onlinegdb.com/Z0no-dI4B)
0.79
t3_tymxkf
1,649,365,805
Python
Automate Investopedia stock simulator with Investopedia-bot
I made this [program](https://github.com/bassel27/Investopedia-Bot) which allows you to automate Investopedia and compare the stocks you're interested in to take better decisions. What do you think?
0.6
t3_tymrnf
1,649,365,341
Python
Abandoned Docker Library?
Apologies if this isn't the right forum to raise this. I'm hoping folks here might have some insight or can point me in the right direction. I have a build tool that relies on the official Docker library for Python: [https://github.com/docker/docker-py](https://github.com/docker/docker-py) It seems like this library has been mostly abandoned by Docker. There hasn't been any new commits for almost 6 months, there are a large number of issues and pull requests that appear to be languishing, and the code owners seem to have sparse activity on GitHub. Anyone know what gives? Is Docker abandoning the Python library since docker compose is being refactored into GoLang?
0.84
t3_tylcez
1,649,361,461
Python
Getting started with Python - programming in Python 3.
0.44
t3_tyl0o2
1,649,360,548
Python
I built an all-in-one Python Web and AI/ML Resources Website
Hey there, I just built a Python Resources Website. Divided into two main Pages (Web Backend and AI/Machine Learning) for these Resources, the goal is to simplify the search for some of the best React resources such as: **1) For Python/Backend:** • Django, Flask, FastAPI Articles • Django, Flask, FastAPI Forums latest Discussions (Reddit) • Django, Flask, FastAPI YouTube Channels Videos • Django, Flask, FastAPI Websites • Django, Flask, FastAPI E-books, Snippets • *Job Opportunities (soon)* ​ **2) For Python/AI/ML:** • AI/ML Articles • AI/ML Forums latest Discussions (Reddit) • AI/ML YouTube Channels Videos • AI/ML Websites • AI/ML E-books, Snippets • *Job Opportunities (soon)* ​ **Here is the Link 👉** [**helloPython**](https://hellopython.vercel.app/) ​ Feel free to give some feedback, I'd like to keep pon working on this project because I love the Python Industry ;) Thank You!
0.58
t3_tyi792
1,649,352,775
Python
Send me suggestions
Hello, I am 18 and I have started to code last year. I want to check my code (if it is good or not, send me suggestions ;) ) with this example of the ticktacktoe game in the terminal. Available here : [https://github.com/FortisCodis/PyTicTacToe](https://github.com/FortisCodis/PyTicTacToe) Sorry for my bad english I am french... Thanks
0.17
t3_tyhe6o
1,649,350,514
Python
Build a simple bank management system in python with MySQL
0.33
t3_tyh72s
1,649,349,924
Python
Video Introduction to pandas Library in Python
0.33
t3_tygobz
1,649,348,450
Python
Documentation is highly valued, but often overlooked
Hi all, In 2017, Github (opensourcesurveyorg) conducted a survey on open source projects, and we believe that in 2022, some issues are still relevant. ​ https://preview.redd.it/p3nop6uhq4s81.png?width=914&format=png&auto=webp&s=6093f8b9dd8d814002c2b01bff334ecc55f85758 It shows the importance of documentation in an Open source project and how frustrating it can be if it’s not a priority. Some important things, in my opinion: 1. When you encounter documentation problems, help a maintainer and open a change request to improve them. 2. Licenses are by far the most important type of documentation for users and contributors. 3. Documentation helps build engaged communities. 4. When communicating about a project, use language that is clear and accessible to people who are not born English or do not read English fluently. I work for an open-source project; please feel free to comment if you have any tips for improving documentation.
0.62
t3_tygibq
1,649,347,990
Python
Maze Creator
I created a website to create and play with mazes. Website Link: https://desolate-mountain-91027.herokuapp.com/home/ GitHub Link: https://github.com/ShouvikGhosh2048/MazeCreator I would like feedback on the website and code.
0.5
t3_tyg1cd
1,649,346,669
Python
Add machine learning to your apps easily with Google's MediaPipe and Python (Beginner's Guide)
Hey everyone! **I just released** [**this beginner's guide**](https://www.assemblyai.com/blog/mediapipe-for-dummies/) **to using MediaPipe in Python**. MediaPipe provides really easy-to-use APIs for common ML tasks like hand recognition, face tracking, object detection, and more! You can use it to add ML to apps for things like sign language recognition! Here's a video of how it performs extracting 3D pose data from a video: ​ https://reddit.com/link/tyftwn/video/w02ochs5n4s81/player Let me know what you think!
0.8
t3_tyftwn
1,649,346,097
Python
Friends and I are tired of online tutorials so we’re running a cohort for learning Python with competitive team games
Hi, we’re a group of 4 friends who are working on something we think is cool but want to hear what you think! We’re super early in working on this - if you want this to exist, register interest on [https://delta-academy.xyz](https://delta-academy.xyz/) :) The best experiences we had when learning Python were working on projects and hackathons. We also benefited from being in cohorts of learners (e.g. at University) - the friends we made have often lasted. We want to combine these two elements - live competitive coding games with a cohort of fellow Python learners. The cohort will be \~20 people. It’s the format we wanted but couldn’t find online - so we’re creating it! We would have to charge for running cohorts (not least to cover the prizes!), but haven’t figured out how much yet - just want to know first if this is something anyone wants! We made a short video that hopefully explains everything in 1 min. https://reddit.com/link/tye97u/video/hbsy8qs594s81/player Really keen to hear feedback. :)
0.9
t3_tye97u
1,649,341,649
Python
Palmette JS | Python and other language template generator.
Hi everyone, I recently made this CLI app that can generate a lot of templates (many in python) of different programming language. Can I ask for a review? Is this a good idea or nah? (You can install it with "npm install -g palmette-js") [https://github.com/PalmetteJS/Palmette-js](https://github.com/PalmetteJS/Palmette-js)
0.67
t3_tycthh
1,649,337,218
Python
Making a face-controlled keyboard (Python OpenCV + MediaPipe)
0.33
t3_tycls0
1,649,336,539
Python
Rtree 1.0 released
0.77
t3_tyb398
1,649,331,385
Python
How to summarize text with Python and machine learning
Summarization is a very common task that many developers would like to automate. For example wouldn't it be nice to automatically create a summary of each blog article you're writing? Or automatically summarize documents for your employees? Tons of good applications exist. In this article I'm showing how easy it is to perform advanced text summarization in Python thanks to Transformers and Bart Large CNN: [https://nlpcloud.io/how-to-summarize-text-with-python-and-machine-learning.html](https://nlpcloud.io/how-to-summarize-text-with-python-and-machine-learning.html?utm_source=reddit&utm_campaign=la5u8885-fd8e-21eb-ca80-5242ac13d5ja) Please don't hesitate to ask questions if you have any!
0.85
t3_tyazf7
1,649,330,969
Python
extreqs: parsing package extras from a requirements.txt
I found myself writing the same logic in a couple of `setup.py` scripts so wrote a package to do it: https://pypi.org/project/extreqs/ Broadly, it parses your `extras_require` dict from your `requirements.txt` file using special comments rather than having to define the same thing twice. As noted in the documentation, there are situations where you wouldn't want to use this, most commonly for libraries. requirements.txt and package dependencies have different purposes in that case: requirements.txt provides a full, (somewhat) reproducible environment for CI and other developers to get an environment with hard versions and all of your linters etc., where package dependencies provide a minimal, permissive environment to allow as many people to use your library as possible. extreqs is primarily designed for applications (web backends, CLIs etc) which have optional extra functionality. (N.B. not a beginner but it's not a complicated enough codebase to merit anything else...)
0.67
t3_tyapmu
1,649,329,932
Python
GitHub - corpnewt/ProperTree: Cross platform GUI plist editor written in python.
0.5
t3_ty8hba
1,649,320,332
Python
How To Learn Python
0.33
t3_ty8fp5
1,649,320,121
Python
I made a game from scratch in 48 hours for the Ludum Dare with Python
I made all of the code, artwork, sfx, etc. solo during the 48 hours of the Ludum Dare as required by the rules. https://i.redd.it/acex0iv0y1s81.gif The game (and its source) are available here: [https://dafluffypotato.itch.io/explont](https://dafluffypotato.itch.io/explont) I also [livestreamed almost all of the development](https://www.youtube.com/playlist?list=PLX5fBCkxJmm1is3hgaBi037MEGFjtHJex) and created a [timelapse](https://youtu.be/4cgjYlH2g9g). ​ https://preview.redd.it/eat9owgny1s81.png?width=631&format=png&auto=webp&s=5cae8fd8386d01c91135a834685bbaeecb97413a
0.97
t3_ty6yvn
1,649,313,627
Python
Dockersh : A shell for docker commands with autocomplete
Hi everyone, I was learning Docker and felt that it was hard to remember all the commands and various arguments. I also kept forgetting the names of my containers & images so I decided to build a CLI for Docker using Prompt Toolkit. Hopefully it will be useful for those of you learning & working with devops. Let me know how I can improve. The project can be found at [https://github.com/solamarpreet/dockersh](https://github.com/solamarpreet/dockersh)
0.67
t3_ty6f0a
1,649,311,338
Python
Continuous feedback and the 'definition of done'
Hey! I wrote a post about what I see is sometimes the short fallings of 'definition of done'. Wonder whether you guys agree with it and have been dealing with such issues? [https://betterprogramming.pub/youre-never-done-by-definition-c04ac77c616b](https://betterprogramming.pub/youre-never-done-by-definition-c04ac77c616b)
0.5
t3_ty5lnw
1,649,308,203
Python
What is the best Python -> direct executable package / compiler today? (April,2022)
I need to create a few applications that I want to distribute as executables, the options I'm aware of are: Nuitka pyinstaller py2exe py2app What else is out there, and what is the BEST? I'm looking to create a couple of cli's using click, and a couple of GUI's using DearPyGui
0.93
t3_ty36vb
1,649,299,895
Python
Pong game in just 14 lines.
import pygame pygame.init() win = pygame.display.set_mode((800, 600)) clock = pygame.time.Clock() rects = [pygame.Rect(0, 0, 20, 60), pygame.Rect(780, 0, 20, 60), pygame.Rect(390, 290, 20, 20)] ball_vel = [5, 5] while clock.tick(60) and not pygame.QUIT in [event.type for event in pygame.event.get()]: keys = pygame.key.get_pressed() rects = rects[0].move(0, (keys[pygame.K_s] - keys[pygame.K_w]) * 5).clamp(win.get_rect()), rects[1].move(0, (keys[pygame.K_DOWN] - keys[pygame.K_UP]) * 5).clamp(win.get_rect()), rects[2].move(*ball_vel) rects[2].topleft = (390, 290) if rects[2].x < 0 or rects[2].right > 800 else rects[2].topleft ball_vel[1], ball_vel[0] = -ball_vel[1] if rects[2].y < 0 or rects[2].bottom > 600 else ball_vel[1], -ball_vel[0] if rects[2].collidelist(rects[:-1]) != -1 else ball_vel[0] win.fill((0, 0, 0)) [[pygame.draw.rect, pygame.draw.ellipse][1 if rect == rects[2] else 0](win, (255, 255, 255), rect) for rect in rects] pygame.display.update()
0.83
t3_ty15no
1,649,293,551
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_txzwcj
1,649,289,609
Python
I made the game Wordle in Python
This game is somewhat similar to hangman. You try to guess a random 5 letter word and the game will tell you the if the placement of each letter is correct or not. Example: ``` O - correct place ? - right letter, wrong place X - letter is present in word Word we're looking for: hello Your word (input): house Output: O?XX? ``` This continues until you guess the word or give up. You can look at the code here: [https://github.com/Nextross/Wordle-python](https://github.com/Nextross/Wordle-python) Any feedback is welcomed!
0.72
t3_txvx5q
1,649,278,243
Python
The last Python 3.11 alpha (3.11.0a7) is available
0.95
t3_txuukh
1,649,275,361
Python
Continuous Feedback over code
Hey everyone! We made something! I wanted to get your feedback on our new open-source platform - Digma. Digma provides observability 🔭 over code and makes it relevant to feature development. It gleans code-relevant insights from OpenTelemetry and other sources and provides in-code feedback 💻. [https://github.com/digma-ai/digma](https://github.com/digma-ai/digma) Python is our first supported language. I'm the author of Digma and am really keen to hear your thoughts!
0.57
t3_txrs93
1,649,267,039
Python
Blog API built with FastAPI, MySQL, SQLAlchemy, and Alembic
0.75
t3_txrlz4
1,649,266,567
Python
A practical introduction solving differential equations numerically
0.83
t3_txq7d2
1,649,262,787
Python
Configpile: a modern, typed argparse replacement
I started documenting astronomy code written by a PhD student, and wanted a command-line parsing library that would be self documenting. Thus [ConfigPile](https://denisrosset.github.io/configpile/) was born! It's based on dataclasses with annotated types. Sample code (imports omitted): @dataclass(frozen=True) class Calc(Config): """ A simple calculator """ #: First number to add x: Annotated[float, Param.store(parsers.float_parser, short_flag_name="-x")] #: Second number to add y: Annotated[float, Param.store(parsers.float_parser, short_flag_name="-y")] c = Calc.from_command_line_() print(f"{c.x} + {c.y} = {c.x+c.y}") Running this with "-h", you can a nice usage help automatically generated (through a legacy ArgumentParser). The same can feed the [sphinx-argparse](https://sphinx-argparse.readthedocs.io/en/latest/) extension to include documentation in the project web pages. Configpile is based on modern Python, is written in mostly functional style, has user-friendly error reporting which accumulates errors instead of bailing out immediately, supports environment variables and INI files. I'd be super grateful for comments, especially about the documentation and the Python style. Follow a tutorial here: https://denisrosset.github.io/configpile/tutorial/index.html Learn about the main concepts here: https://denisrosset.github.io/configpile/concepts/index.html The package can be easily installed using `pip install configpile` (Note: many edits for formatting)
0.83
t3_txq6ch
1,649,262,713
Python
Show the songs that you are listening to on Telegram. (Like Discord's "Listening to") [Recently updated]
0.5
t3_txp8kf
1,649,260,175
Python
UNPHAT method for designing apps
I found this to be very useful when thinking about the most important part of writing apps: understanding what to solve and how. It's from https://news.ycombinator.com/item?id=30931831. Next time you find yourself Googling some cool new technology to (re)build your architecture around, I urge you to stop and follow UNPHAT instead: Don’t even start considering solutions until you Understand the problem. Your goal should be to “solve” the problem mostly within the problem domain, not the solution domain. eNumerate multiple candidate solutions. Don’t just start prodding at your favorite! Consider a candidate solution, then read the Paper if there is one. Determine the Historical context in which the candidate solution was designed or developed. Weigh Advantages against disadvantages. Determine what was de-prioritized to achieve what was prioritized. Think! Soberly and humbly ponder how well this solution fits your problem. What fact would need to be different for you to change your mind? For instance, how much smaller would the data need to be before you’d elect not to use Hadoop?
0.67
t3_txoq2p
1,649,258,798
Python
I made a small tool to apply "color palette restriction" on images !
I got inspired by /r/place and I wanted to exercice my python skills so I tried to make a tool to redraw images with a specific color palette (/r/place color palette) Here are some examples : [Reference image](https://preview.redd.it/3p4us69n7xr81.jpg?width=494&format=pjpg&auto=webp&s=0535c1eed010716f053549eec31a88d4453f2f6e) [Color palette restriction without dithering](https://preview.redd.it/63df44kt7xr81.png?width=494&format=png&auto=webp&s=341497026bb4dd39dc63718cf792ba1e1f3030ef) [Color palette restriction with Floyd-Steinberg dithering](https://preview.redd.it/xccpwquw7xr81.png?width=494&format=png&auto=webp&s=8156a2f09de8b2a58c92f72ef90a5b017a1df2a7) It can also work with any color palette provided ! Also, I am using PIL to read and draw on images. ​ You can find the source code here : [https://github.com/nrbt25/image-dithering/tree/master](https://github.com/nrbt25/image-dithering/tree/master)
0.97
t3_txnuzx
1,649,256,498
Python
YAML: The Missing Battery in Python
0.88
t3_txmfli
1,649,252,420
Python
Programming projects for Physics in Python
So I am looking for some projects to do in Physics using Python ,when I searched for the same in Quora ,it was too hard to even comprehend . I am ready to do some reading if it is needed ,I don't like learning Python just through some courses ,I think that learning by creating projects will be a good motivation. I have knowledge of Calc 1,2,3 a bit of Linear Algebra ,basics of solving diff equations . I am taking Classical Mechancis and Electromagnetism . Any suggestion ,I am aiming to score an internship with this project . Thank you for reading my post . Have a nice day
0.79
t3_txm6zl
1,649,251,713
Python
hello this could be an english vocabulary question, what does comprehension mean from 'List Comprehension'? I already learned that is like set builder notation
0.61
t3_txk1nm
1,649,244,748
Python
Scrape Naver Related Search Results with Python
Full DIY code: ```python import requests, json from parsel import Selector # https://parsel.readthedocs.io/ # https://docs.python-requests.org/en/master/user/quickstart/#passing-parameters-in-urls params = { "query": "minecraft", # search query "where": "web" # web results. works with nexearch as well } # https://docs.python-requests.org/en/master/user/quickstart/#custom-headers headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36", } html = requests.get("https://search.naver.com/search.naver", params=params, headers=headers, timeout=30) selector = Selector(html.text) related_results = [] # https://www.programiz.com/python-programming/methods/built-in/enumerate for index, related_result in enumerate(selector.css(".related_srch .keyword"), start=1): keyword = related_result.css(".tit::text").get().strip() link = f'https://search.naver.com/search.naver{related_result.css("a::attr(href)").get()}' related_results.append({ "position": index, # 1,2,3.. "title": keyword, "link": link }) print(json.dumps(related_results, indent=2, ensure_ascii=False)) ``` Outputs: ```json [ { "position": 1, "title": "마인크래프트", "link": "https://search.naver.com/search.naver?where=nexearch&query=%EB%A7%88%EC%9D%B8%ED%81%AC%EB%9E%98%ED%94%84%ED%8A%B8&ie=utf8&sm=tab_she&qdt=0" }, { "position": 2, "title": "minecraft 뜻", "link": "https://search.naver.com/search.naver?where=nexearch&query=minecraft+%EB%9C%BB&ie=utf8&sm=tab_she&qdt=0" }, { "position": 3, "title": "craft", "link": "https://search.naver.com/search.naver?where=nexearch&query=craft&ie=utf8&sm=tab_she&qdt=0" }, { "position": 4, "title": "mine", "link": "https://search.naver.com/search.naver?where=nexearch&query=mine&ie=utf8&sm=tab_she&qdt=0" }, { "position": 5, "title": "mojang", "link": "https://search.naver.com/search.naver?where=nexearch&query=mojang&ie=utf8&sm=tab_she&qdt=0" } ] ``` Alternative solution using [Naver Related results API](https://serpapi.com/naver-related-results) from SerpApi: ```python from serpapi import NaverSearch import os, json params = { # https://docs.python.org/3/library/os.html#os.getenv "api_key": os.getenv("API_KEY"), # your serpapi api key "engine": "naver", # search engine to parse results from "query": "minecraft", # search query "where": "web" # web results } search = NaverSearch(params) # where data extraction happens results = search.get_dict() # JSON -> Python dictionary related_results = [] # iterate over "related_results" and extract position, title and link for related_result in results["related_results"]: related_results.append({ "position": related_result["position"], "title": related_result["title"], "link": related_result["link"] }) print(json.dumps(related_results, indent=2, ensure_ascii=False)) ``` Outputs: ```json [ { "position": 1, "title": "마인크래프트", "link": "https://search.naver.com?where=nexearch&query=%EB%A7%88%EC%9D%B8%ED%81%AC%EB%9E%98%ED%94%84%ED%8A%B8&ie=utf8&sm=tab_she&qdt=0" }, { "position": 2, "title": "minecraft 뜻", "link": "https://search.naver.com?where=nexearch&query=minecraft+%EB%9C%BB&ie=utf8&sm=tab_she&qdt=0" }, { "position": 3, "title": "craft", "link": "https://search.naver.com?where=nexearch&query=craft&ie=utf8&sm=tab_she&qdt=0" }, { "position": 4, "title": "mine", "link": "https://search.naver.com?where=nexearch&query=mine&ie=utf8&sm=tab_she&qdt=0" }, { "position": 5, "title": "mojang", "link": "https://search.naver.com?where=nexearch&query=mojang&ie=utf8&sm=tab_she&qdt=0" } ] ``` The difference between DIY and API solution is that you don't need to create the parser from scratch, maintain it, or figure out how to bypass blocks from Naver. Full blog post: https://serpapi.com/blog/scrape-naver-related-search-results-with-python/
0.4
t3_txif8z
1,649,238,341
Python
Extending pylint with plugins
0.5
t3_txfsuz
1,649,226,686
Python
A Practical Introduction To Web Scraping With Python
0.96
t3_txf65f
1,649,224,130
Python
Python email sender
Hi everyone, I have created a script that sends an email to whoever I want using data retrieved from an API (I chose News API, and it will send me the top 20 news of the day). [https://github.com/jrodriigues/news-email-sender](https://github.com/jrodriigues/news-email-sender) Take a look, let me know what you think, and how to improve it!
0.56
t3_txd85l
1,649,217,069
Python
I made my first ever programming assignment into a youtube tutorial
0.5
t3_txbulk
1,649,212,511
Python
Termtyper - Typing in terminal is fun !
Termtyper is a TUI (Text User Interface) typing application that provides you a great feel with typing with a lot of options to tweak! It is highly inspired by [monkeytype](https://monkeytype.com/) It is built on top of [textual](https://github.com/Textualize/textual) which provides the UI for the application github: [https://github.com/kraanzu/termtyper](https://github.com/kraanzu/termtyper) ​ https://reddit.com/link/txbsdd/video/ojo8k2o3mtr81/player
0.82
t3_txbsdd
1,649,212,316
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.
1
t3_tx8uqj
1,649,203,209
Python
Why and how to use conda?
I'm a data scientist and my main is python. I use quite a lot of libraries picked from github. However, every time I see in the readme that installation should be done with conda, I know I'm in for a bad time. Never works for me. Even installing conda is stupid. I'm sure there is a reason why there is no "apt install conda"... Why use conda? In which situation is it the best option? Anyone can help me see the light?
0.9
t3_tx73j8
1,649,198,092
Python
Online coding video tutorials - Opinions
Hello everyone, I am currently creating some space science + Python [YouTube tutorials](https://youtube.com/c/Astroniz). In these videos I do some coding and provide some explanations on what I am doing, the science behind it etc. Now I was wondering whether this is a good approach at all. I really like creating some content on YouTube (no I am not a professional one with my few 100 subscribers), and I am eager to improve it steadily. However I thought that "live coding" may take too much time and isn't easy to follow. My idea is to explain e.g., science related Jupyter Notebook cells in the videos to shorten the length. The code is provided on GitHub anyway, so a viewer could follow my tutorial (and thoughts) more easily. The coding would be reduced to a minimum and the focus could move to the "non coding" part. Any ideas or comments would be appreciated! Thomas
0.6
t3_tx6k1q
1,649,196,551
Python
Rubik's Cube Model in Python using OOP
I've been thinking for a while about developing a model to simulate a Rubik's cube in Python. I wanted to make use of object-oriented programming, and this project was the perfect excuse to get down to work. 💻⌨️🖖 https://carlosgrande.me/rubiks-cube-model/
0.78
t3_tx6gfb
1,649,196,238
Python
What happened between SciPy creater Travis Oliphant and Enthought?
I was listening to his interview on the [Lex Friedman podcast](https://open.spotify.com/episode/2U2AkSSuAzmZi7nmGzJboW?si=28e8c7d915e04f75) and he mentioned that he is no longer friends with the founder of Enthought because he started Anaconda. I can't find any details online, does anyone know the story?
0.79
t3_tx67bv
1,649,195,579
Python
My first package to pypi. Connpy: Network connection manager and automation module
Hi! So a little bit of background, I'm a network engineer (ccie), with 10+ years of experience in networking, and i'm a really lazy guy so usually i try to automate and script everything. long time ago i created my bash connection manager and been using it since. A month ago i decided it was time to upgrade it to python and add the automation function i always wanted, and that is how connpy was born. I'm not a programmer so it may have some issues! let me know. [https://github.com/fluzzi/connpy/](https://github.com/fluzzi/connpy/) <- here is the link, it also have some documentation it should be easy to use. It's created for linux as it's what i use everyday but i did some testing on macos and it should work. ## connection manager First its the connection manager, it adds the commands conn/connpy to shell, and you can add all the devices you manage easily: - conn --add server1 you can add folders and subfolders to organize your devices. i use to work with a lot of clients so i have like 400+ nodes divided in multiples folders. - conn --add "@office" - conn --add "@servers@office" - conn --add server2@servers@office - conn --add server3@servers@office - conn --add router1@office when you are creating a new node to connect, it allows you to refer profiles, this way you can manage passwords and other information in 1 place and use it in multiple nodes. - conn profile --add officeuser then you reference inside the node configuration using "@officeuser". you can use profiles to send multiple passwords in case you use 1 or more jumphosts. Once the nodes are created you just connect to them without passwords. - conn server1 - conn server2@servers@home - conn server ## automation module this is the new feature, once you created your nodes you can use them with the automation module - import connpy - config = connpy.configfile() - server1 = config.getitem("server1@office") - router1 = config.getitem("router@office") - server = connpy.node("server1",**server1,config = config) - router = connpy.node("router1",**router1,config = config) - print(router.run(["term len 0", "show run"])) - if server.test("ls -la", "folder to find"): - print("folder found") - else: - print("missing folder") You can also run in multiple devices at the same time using class nodes. (more in the documentation) Hope someone find it useful!! thanks!
0.67
t3_tx604l
1,649,195,030
Python
"Bicycle or Metro": My first interactive web app using Dash/Flask.
I collected data from the Google Direction API and built an interactive app comparing travel duration times between Bicycle and Public Transportation in Santiago, Chile. Each specific route to a point in the map can be accessed by clicking on the destination point, and the relevant information will be displayed. The app is deployed on Heroku (forgive the slow response): [http://biciometro.herokuapp.com](http://biciometro.herokuapp.com) . The website is in Spanish, but its features should be easy to understand. **Tools:** * For the GeoJSON grid, I used this [grid creator](https://cityofaustin.github.io/geojson-grid/#). I used Pandas, Dash, Plotly, NumPy and Mapbox. Everything is coded in Python. * Source code for the app: [https://github.com/mirkosimunovic/biciometro](https://github.com/mirkosimunovic/biciometro) * Please show support with a Github star if you like the project. Thank you!
0.81
t3_tx4xj4
1,649,192,222
Python
Create a timelapse of any canvas area and any timeframe of r/place
[(Github) Source code and download](https://github.com/gislerro/rplace-cropped-timelapse-creator) Configuration in the config.yaml file: * range of images to create timelapse for [(archive of snapshots here)](https://rplace.space/combined/) * granularity of frames (take every n-th image - determines speed of timelapse) * top-left coordinates of the canvas timelapse * width & height of the canvas * mp4 output dimensions & name ​ [Example](https://reddit.com/link/tx3x67/video/vgytvsfpprr81/player)
0.87
t3_tx3x67
1,649,189,564
Python
Applications of Python
Hey! Anyone who is interested in learning about the applications of python in the field of automation should check out [this](https://medium.com/@Nick_27/automation-using-python-66ec75a6b0ba) article. It really encourages you to learn more about the language!
0.3
t3_tx0enu
1,649,180,149
Python
Learning Python
Python just makes so much freaking sense! LOVING IT!!
0.8
t3_tx0cns
1,649,179,997
Python
Running a live 45-minutes session on the fundamentals of observability, OpenTelemetry, and distributed tracing with microservices messaging systems (Kafka, RabbitMQ, etc)
Hi everyone, we're running another live OpenTelemetry and observability fundamentals session - Wednesday, April 20 at 11 AM PDT. You will learn how to instrument your message brokers and apps to capture traces with OpenTelemetry. This session is at no cost and vendor-neutral. You can expect in this session: 45 minutes of core concepts, how to deploy it yourself hands-on + Q&A. If you are interested in observability, OpenTelemetry, and tracing - join! Register here [https://www.aspecto.io/opentelemetry-fundamentals/messaging-systems/](https://www.aspecto.io/opentelemetry-fundamentals/messaging-systems/?utm_source=post&utm_medium=reddit&utm_campaign=r-python-opentelemetry-fundamentals-messaging-systems)
0.4
t3_tx097t
1,649,179,745
Python
As of today, how well does Anaconda run on M1 MacBook Pro?
Last year, there was an article from the developer that they were working on M1 version of the software suite. However, I don't seem to hear any news after that. Are they still working on it? I recall there were some compatibility issues with some packages last year. How well does it run on M1 MacBook Pro as of today? Are Anaconda and its packages fully compatible with M1 Mac now?
0.75
t3_tww564
1,649,168,665
Python
Attending my first PyCon US 2022 (SLC) - tips?
What recommendations would you have for someone new to this conference? I am new to programming and a beginner learning python (self-taught). Hoping to network, learn about new ideas to get my excited, and do some running in a new place.
0.9
t3_twr5wj
1,649,151,796
Python
Reason to go from Python3.9 to 3.10 ?
I don't find and real advantages and all i have to do works fine on 3.9. Change my mind.
0.42
t3_twq7my
1,649,147,520
Python
I'm presenting live in 6 hours at Microsoft Reactor online about troubleshooting Python applications, especially on Kubernetes. (Part 2 of the Python on Kubernetes series.) Let me know your questions in advance
0.89
t3_twpt1m
1,649,145,681
Python
Python Firebird-driver 1.4.3 released
0.71
t3_twpopx
1,649,145,186
Python
How to Execute SQL Queries in Python and R Tutorial
0.58
t3_twpo9w
1,649,145,127
Python
Community for Python app developers
Hey, I'm curious if there is a dedicated community of Python developers who are making apps with frontend interface. (As opposed to data analysis or training ML models). For example, developers who are using Streamlit or Anvil. (Are there any other big ones?) Do you know any such communities?
0.64
t3_twpbuw
1,649,143,631
Python
Python and the Truth
Hi folks, Excited to share some notes on Python's Truth values, their internals, and possible applications. [https://towardsdatascience.com/python-and-the-truth-90cf08380246](https://towardsdatascience.com/python-and-the-truth-90cf08380246) Thanks and happy reading!
0.5
t3_twoqza
1,649,141,265
Python
Why is Python becoming indispensable in IoT Industry?
IoT Applications are usually pre-built SaaS (software-as-a-service) applications. These can present and analyze captured IoT sensor data to businesses via dashboards. They use machine learning algorithms and analyze huge amounts of connected sensor data in the cloud. Real-time IoT alerts and dashboards provide you visibility into key performance indicators, statistics for the meantime between failures, and other details.
0.27
t3_two0m1
1,649,138,209
Python
I got a little problem with my visualization program.
I find a great code of visualizing the PSO algorithm in 2D. And I tried to change it into 3D.I've done the majority part of it, but now the particles just don't update, they superpose over the old ones. [Figure shows like this](https://preview.redd.it/fhiagfvecnr81.png?width=1102&format=png&auto=webp&s=6ed3c223f26d9407aecc242b2facc2e23458e16f) ​ Here is the code link: [https://linkode.org/#LsQHmirehTrbP1pqXEI2Q5](https://linkode.org/#LsQHmirehTrbP1pqXEI2Q5)
0.5
t3_twm7ke
1,649,131,590
Python
Visualize Differential Equations
[https://www.youtube.com/watch?v=gH47pQHeKDE](https://www.youtube.com/watch?v=gH47pQHeKDE) Normalize for your highest order derivative and plug in your initial conditions to numerically solve any differential equation
0.57
t3_twjqds
1,649,123,664
Python
Use nested GitHub Action Runners to reduce costs by up to 50% for multiple jobs in one workflow
0.9
t3_twhorh
1,649,117,806
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.
0.72
t3_twha21
1,649,116,810
Python
Predicting the Champions League with Python! (21/22)
0.67
t3_twgvyu
1,649,115,763
Python
I published my first tutorial on YouTube: Insertion sort explained + Python code
0.71
t3_twe9kh
1,649,109,341
Python
I made use of Zoho Sheets and used it as a database engine
I started working on this yesterday and have just finished rewriting it into classes and publishing it as a PyPI project :) This module uses Zoho Sheets (which is completely free to use) as a way to store data. I'm keen on the development of ZohoDB.py and aiming to keep improving it's performance in order to make it a kinda production-ready module :) Would love to hear your feedback on this one https://github.com/oddmario/zohodb.py
0.86
t3_tw954f
1,649,096,725
Python
Create python logo on r/place
I in the r/place we can create a python logo on 384,1618
0.29
t3_tw8p3f
1,649,095,625
Python
Voice Controlled Switch Using Arduino & Python
1
t3_tw8ace
1,649,094,644
Python
Python f-strings Are More Powerful Than You Might Think
0.93
t3_tw69i5
1,649,089,724
Python
Book for python network programming
Hey folks, can you please recommend a good book(s) for network programming? Something that would cover subjects from low level TCP/IP, to SMTP/SSH/HTTP/etc libraries? Thanks in advance!
1
t3_tw5tru
1,649,088,639
Python
Head-first Kubernetes - A hands-on tutorial for beginners
0.85
t3_tw50n4
1,649,086,671
Python
Active Learning in Machine Learning Explained
0.57
t3_tw4o2v
1,649,085,795
Python
Can my IT department tell (without any sortve deep dive) that I'm using a python script to login?
I have to do timesheets for my crew every morning, and it takes about twenty minutes a day. I've long since thought I could automate this, and write a little proof of concept and it worked. It would however involve using pyautogui to enter my login information including password into our time management software. Do you think this could get me into shit with the IT department?
0.95
t3_tw2ozp
1,649,080,757
Python
StackSocial Discount. Are their courses any good?
I saw that they were offering a 'complete Python certification bundle' for $35 'reduced from $2k' if you can believe that. I'm beginner to intermediate - written some Flask websites and programmed some automated stuff, so I was wondering if anyone would recommend this sort of thing to get into Python programming professionally?
0.43
t3_tw2ihc
1,649,080,260
Python
Rock, Paper, Scissors
LMK what I can do differently. Thanks! ​ running = True while running: player1 = input(" (Player1) Rock, Paper, or Scissors:\\n >") player2 = input(" (Player 2) Rock, Paper, or Scissors:\\n >") if player1.lower() == "rock" and player2.lower() == "scissors": print("Player 1 Wins!") if player2.lower() == "rock" and player1.lower() == "scissors": print("Player 1 Wins!") if player1.lower() == "paper" and player2.lower() == "scissors": print("Player 2 Wins!") if player2.lower() == "paper" and player1.lower() == "scissors": print("Player 1 Wins!") if player1.lower() == "rock" and player2.lower() == "paper": print("Player 2 Wins") if player2.lower() == "rock" and player1.lower() == "paper": print("Player 1 Wins") playing = input("Do you want to keep playing? y/n \\n > ") if playing.lower() == "n": break if playing.lower() == "y": running = True
0.6
t3_tw0wkp
1,649,075,628
Python
Solving and Animating the 3D Double Pendulum in Python: Sympy for algebra, Scipy for numerically solving differential equations, and vpython for 3D animation
0.81
t3_tw0eck
1,649,073,978
Python
ConfigParser - manage user-editable settings for your Python programs
0.43
t3_tvzwqb
1,649,072,412
Python
Scraping Naver Videos in Python
Full code: ```python import requests, os, json from parsel import Selector def parsel_scrape_naver_videos(): params = { "query": "minecraft", # search query "where": "video" # video results } headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.87 Safari/537.36", } html = requests.get("https://search.naver.com/search.naver", params=params, headers=headers, timeout=30) selector = Selector(html.text) # very similar to bs4, except parsel supports Xpath video_results = [] for video in selector.css(".video_bx"): # https://parsel.readthedocs.io/en/latest/usage.html#using-selectors title = video.css(".text::text").get() link = video.css(".info_title::attr(href)").get() thumbnail = video.css(".thumb_area img::attr(src)").get() channel = video.css(".channel::text").get() origin = video.css(".origin::text").get() video_duration = video.css(".time::text").get() views = video.css(".desc_group .desc:nth-child(1)::text").get() date_published = video.css(".desc_group .desc:nth-child(2)::text").get() video_results.append({ "title": title, "link": link, "thumbnail": thumbnail, "channel": channel, "origin": origin, "video_duration": video_duration, "views": views, "date_published": date_published }) print(json.dumps(video_results, indent=2, ensure_ascii=False)) ``` Part of the output: ```json [ { "title": " : 🌲 How to build Survival Wooden Base (#3)", "link": "https://www.youtube.com/watch?v=n6crYM0D4DI", "thumbnail": "https://search.pstatic.net/common/?src=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fn6crYM0D4DI%2Fmqdefault.jpg&type=ac612_350", "channel": "소피 Sopypie", "origin": "Youtube", "video_duration": "24:06", "views": "671", "date_published": "4일 전" }, { "title": "마인크래프트 무한순환 이론 (", "link": "https://www.youtube.com/watch?v=kQ7wyG9mShQ", "thumbnail": "https://search.pstatic.net/common/?src=https%3A%2F%2Fi.ytimg.com%2Fvi%2FkQ7wyG9mShQ%2Fmqdefault.jpg&type=ac612_350", "channel": "TV블루위키", "origin": "Youtube", "video_duration": "01:44", "views": "9만", "date_published": "2022.02.15." } ... other results ] ``` Blog post link if you need code explanation: https://serpapi.com/blog/scrape-naver-video-results-with-python/
0.5
t3_tvzlgk
1,649,071,317
Python
Creating A Modern Python Development Environment
0.69
t3_tvyvov
1,649,068,761
Python
Different types of implementation of polymorphism
Hi All, I am reading about OOP in python and wonder if we implement ` __add__`, `__sub__` etc, it looks to me thst we are doing operator overloding. So my question is, that is it correct to think like that and does this implementation falls under AdHoc polymorphism in python. Thanks Pradeep
0.6
t3_tvx5ee
1,649,061,795
Python
CaptchaCracker - Deep Learning-based Captcha Recognizer
Hello! I made a python open source project. **Github Repository:** [https://github.com/WooilJeong/CaptchaCracker](https://github.com/WooilJeong/CaptchaCracker) # CaptchaCracker ## Introduction CaptchaCracker is an open source Python library that provides functions to create and apply deep learning models for Captcha Image recognition. You can create a deep learning model that recognizes numbers in the Captcha Image as shown below and outputs a string of numbers, or you can try the model yourself. ## Input https://preview.redd.it/qltiatrqxgr81.png?width=250&format=png&auto=webp&s=8e4d370203ff502b4681c8b35a8fee1cff7fd259 ## Output 023062 ## Installation pip install CaptchaCracker ## Dependency pip install numpy==1.19.5 tensorflow==2.5.0 ## Examples ## Train and save the model Before executing model training, training data image files in which the actual value of the Captcha image is indicated in the file name should be prepared as shown below. * [Download Sample Dataset](https://github.com/WooilJeong/CaptchaCracker/raw/main/sample.zip) https://preview.redd.it/n451dp4sxgr81.png?width=1009&format=png&auto=webp&s=2c0173b4d685f73642edbfd780ae3fdf4d921bdf import glob from CaptchaCracker import CreateModel train_img_path_list = glob.glob("../data/train_numbers_only/*.png") CM = CreateModel(train_img_path_list) model = CM.train_model(epochs=100) model.save_weights("../model/weights.h5") ## Load a saved model to make predictions from CaptchaCracker import ApplyModel weights_path = "../model/weights.h5" AM = ApplyModel(weights_path) target_img_path = "../data/target.png" pred = AM.predict(target_img_path) print(pred)
0.56
t3_tvwizf
1,649,059,109
Python
QualityScaler 1.1.0 - Image/video upscaling & enhancement GUI app based on BRSGAN & RealSR_JPEG
Image/video upscaling GUI app based on BRSGAN & RealSR\_JPEG [GUI interface](https://preview.redd.it/9rxldsstugr81.png?width=1392&format=png&auto=webp&s=4760f210cb169dc95679b5a5183ed0e142cbbad4) ## Links. Github -> [https://github.com/Djdefrag/QualityScaler/releases/tag/1.1.0](https://github.com/Djdefrag/QualityScaler/releases/tag/1.1.0) Itch -> [https://jangystudio.itch.io/qualityscaler](https://jangystudio.itch.io/qualityscaler) ## Credits. *BSRGAN -* [*https://github.com/cszn/BSRGAN*](https://github.com/cszn/BSRGAN) *|* [*https://arxiv.org/abs/2103.14006*](https://arxiv.org/abs/2103.14006) *RealSR\_JPEG -* [*https://github.com/jixiaozhong/RealS*](https://github.com/jixiaozhong/RealS)R | [https://arxiv.org/pdf/2005.01996.pdf](https://arxiv.org/pdf/2005.01996.pdf) ## Installation. QualityScaler is completely portable; just download, unzip and execute the file .exe ## Supported AI Backend. * Nvidia Cuda \[v10.2\] * CPU \[works without GPU, but is very slow\] ## Features. * Easy to use GUI * Images and video upscale * Drag&drop files \[image/multiple images/video\] * Different upscale factors: * auto - automatic choose best upscale factor for the GPU used (to avoid running out of VRAM) * x1   - will mantain same resolution but will reconstruct the image (ideal for bigger images)  * x2   - upscale factor 2: 500x500px -> 1000x1000px * x4   - upscale factor 4: 500x500px -> 2000x2000px * Cpu and Gpu \[cuda\] backend * Compatible images - PNG, JPEG, BMP, WEBP, TIF   * Compatible video  - MP4, WEBM, GIF, MKV, FLV, AVI, MOV  ## Next steps. 1. Use both model for the upscale 2. Include audio for upscaled video 3. Support for other GPUs (AMD, Intel) with new backend ## Example. Original photo (200x200 px) https://preview.redd.it/3yb1t6nxugr81.png?width=220&format=png&auto=webp&s=b950ff4af4cfcb5e2fe97cece00f9b4c7c3f1698 BSRGAN (800x800 px) https://preview.redd.it/wghr3c7yugr81.png?width=880&format=png&auto=webp&s=67360909111338bfb01e111e1fab8cdd6c3531e7 RealSR\_JPEG (800x800 px) https://preview.redd.it/blh6vmlyugr81.png?width=880&format=png&auto=webp&s=68af9f79d102b2c906f8c54bb84fdef44b6db7d2
0.83
t3_tvwbu7
1,649,058,226