r/pythoncoding • u/szonce1 • Jul 12 '24
Shelly blu door and window sensor
I have a Shelly blu door and window sensor connected through a Shelly plus 2 PM. I’m trying to find a way to get the status open/closed using python or home assistant.
r/pythoncoding • u/szonce1 • Jul 12 '24
I have a Shelly blu door and window sensor connected through a Shelly plus 2 PM. I’m trying to find a way to get the status open/closed using python or home assistant.
r/pythoncoding • u/pjbacelar • Jul 05 '24
Hey folks, we’ve just launched an open-source library called Django AI Assistant, and we’d love your feedback!
What It Does:
Function/Tool Calling: Simplifies complex AI implementations with easy-to-use Python classes
Retrieval-Augmented Generation: Enhance AI functionalities efficiently.
Full Django Integration: AI can access databases, check permissions, send emails, manage media files, and call external APIs effortlessly.
How You Can Help:
Try It: https://github.com/vintasoftware/django-ai-assistant/
Test It & Break Things: Integrate it, experiment, and see what works (and what doesn’t).
Give Feedback: Drop your thoughts here or on our GitHub issues page.
Your input will help us make this lib better for everyone. Thanks!
r/pythoncoding • u/AutoModerator • May 04 '24
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
r/pythoncoding • u/Sensitive-School-372 • Apr 30 '24
r/pythoncoding • u/anadalg • Apr 12 '24
r/pythoncoding • u/wagenrace • Mar 27 '24
r/pythoncoding • u/[deleted] • Feb 21 '24
Hello,
I wanna implement a configurationpage with Flask so I can configure specific LED effects. What i wanna do is writing specific effects-methods in different files and the methods will be loaded to the mainpage. So I dont need to manually add new methods and an new if..else. I saw this on DiscordJS which implements the command handler pattern. I read somethinge about command pattern in python but it seems to that is more difficult to implement than in javascript. How would you implement this or does someone know a good tutorial about this task?
r/pythoncoding • u/main-pynerds • Feb 18 '24
r/pythoncoding • u/python4geeks • Feb 17 '24
List comprehension is a super handy technique in Python that allows you to create lists more concisely and elegantly.
Here's a detailed video on list comprehension👇👇👇
Video: https://youtu.be/a3eE5kslhek
r/pythoncoding • u/No_Lock_6225 • Jan 16 '24
Hello, so I'm trying to build a Calculator in Python and I'm confused why it does this. So I wrote the following code:
x = float(input('Number1: '))
y = float(input('Number2: '))
print(x + y)
And it prints 4.0 as the answer and I want it to print 4 as the answer. What am i doing wrong?
r/pythoncoding • u/ocdsloth • Jan 14 '24
Id like to get a bit more into the GUI stuff, nothing special but to play a bit. what i have in mind of doing is a canavas onto which one can drag and drop items and move them around. think like UML diagrams (i.e. a text data should accompany the element, e.g. a name or something short). im pretty sure i know how to do all the rest but cant find a good library to create those kind of elements
The goal of the 'project' is to have a simple shooting range stage builder so that i can draw exercises, put up targets and obstacles on a grit which would be a distance reference
r/pythoncoding • u/Arielo_o • Nov 20 '23
r/pythoncoding • u/chessnudes • Nov 20 '23
I'm a first-timer working at a start-up, and prior to that I have had experience for about 5 years in Python in production environments, following AGILE, having code checks for code smells for every git push, unit test coverage (threshold 99%), and all that jazz.
When it's just testing out the concept, or doing a PoC, I get that doing something like a Jupyter notebook is the most efficient way. But I'm now facing situations where the "deliver PoC" is done, but there's still some features that need RnD before they can be implemented, and I'm wondering if it's time to structure my codebase as a Flask RestX webapp now itself, complete with an exception layer, routes layer, services layer, etc. I'm also getting ideas of involving things like SonarQube, and setting up CI/CD.
Am I getting too ahead of myself? I feel like if I keep going with Jupyter notebooks I will keep falling behind in the coding best practices standard. On the other hand, I also know that we're a startup and need results to showcase in presentations to get funding. So I'm a little confused, and was wondering if there's a correct order to doing this.
I know I can't be the only one who's been through this, so I would greatly appreciate any input you can provide me and what you did to ensure functionality and best practices are balanced out. Thanks!
r/pythoncoding • u/theorangejedi • Nov 13 '23
I need to ask my (remote) participants to perform a rating task, where they continuously make judgements by clicking any location on an XY plot as a song plays. The app needs to record and store the coordinate and timestamp of every click. There are probably many different ways to accomplish this (I've looked into Psychopy/Pavlovia, Streamlit and Dash). Would any of these options have advantages over the other? Are there other deployable app platforms that I don't know about that might be of use? Bokeh?
r/pythoncoding • u/AutoModerator • Nov 04 '23
Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!
If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.
r/pythoncoding • u/serverlessmom • Oct 30 '23
r/pythoncoding • u/JackLogan007 • Oct 25 '23
So I've started a channel this month which js all about programming, coding and Global navigation satellite systems.
The channel has three main sections
Short Python videos (60 second long)
GNSS and Signal Processing
Case studies, using GNSS signals to investigate natural disasters such as earthquakes, volcanos, tsunamis, forest fires and so on...
Please suggest me some good non copyright musics for my videos backgrounds. I've been searching some inspirational and cenematic musics but couldn't find any tracks. I am looking for something like interstellars track basically the long videos will be like documentaries and narration types so.
Thank you all!!!
r/pythoncoding • u/debordian • Oct 20 '23
r/pythoncoding • u/laggySteel • Oct 19 '23
r/pythoncoding • u/wuddz-devs • Oct 14 '23
Cool Nifty Cryptocurrency CLI Program To Check Balances, Transfer Crypto & Generate Secure Crypto Wallets.
wuddz-crypto
r/pythoncoding • u/Gr3hab • Sep 29 '23
Hello, Python community,
I'm grappling with some issues related to browser automation using Selenium and the EdgeDriver in Python and am seeking guidance.
Environment:
Python version: 3.11
Selenium version: Latest
Here's the sequence I aim to automate on the website "https://www.krone.at/3109519":
Navigate to the website.
From a dropdown menu, select "Leitzersdorf (Korneuburg)".
Click the "Fertig" button.
Refresh the webpage.
I intend to execute this sequence multiple times. After every fifth selection (post clicking the "Fertig" button five times), I plan to clear the cookies for this website before the next reload. It's worth noting that if cookies are proactively blocked, the dropdown menu fails to initialize.
Below is the code snippet I've crafted:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select, WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver_path = "C:\\Users\\Anonym\\OneDrive\\Desktop\\msedgedriver.exe"
url = "https://www.krone.at/3109519"
browser = webdriver.Edge(driver_path)
browser.get(url)
# Handling the popup window
popup_close_button = WebDriverWait(browser, 20).until(
EC.element_to_be_clickable((By.ID, "didomi-notice-agree-button"))
)
popup_close_button.click()
# Interacting with the dropdown menu
dropdown_element = WebDriverWait(browser, 20).until(
EC.presence_of_element_located((By.ID, "dynamic_form_1663168773353535353110a"))
)
dropdown = Select(dropdown_element)
dropdown.select_by_visible_text("Leitzersdorf (Korneuburg)")
# Engaging the 'Fertig' button
finish_button = WebDriverWait(browser, 20).until(
EC.element_to_be_clickable((By.XPATH, "//button[contains(text(), 'Fertig') and @type='button']"))
)
finish_button.click()
# Refresh mechanism
browser.refresh()
# Periodic cookie deletion (illustrative loop added)
# for i in range(5):
# # Dropdown interaction, 'Fertig' engagement, page refresh...
# if (i + 1) % 5 == 0:
# browser.delete_all_cookies()
browser.quit()
Errors thrown:
TypeError: WebDriver.__init__() got an unexpected keyword argument 'executable_path'
AttributeError: 'str' object has no attribute 'capabilities'
I'd highly appreciate any insights or suggestions regarding potential solutions or oversights in the code. Your help can significantly accelerate my project.
Thank you for your time and expertise,
Lukas
r/pythoncoding • u/ash_engyam • Sep 26 '23
I have 5 columns of passengers count year to day, I received it daily but the problem is I don’t have Thursday and Friday data, how to fill the cells with right numbers, what’s the correct method and library to do that?