r/pythoncoding • • Jan 04 '25

/r/PythonCoding monthly "What are you working on?" thread

2 Upvotes

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 • • Sep 29 '24

I created FieldList: An alternative to List of Dicts for CSV-style data - Feedback welcome

Thumbnail reddit.com
2 Upvotes

r/pythoncoding • • Jul 12 '24

Shelly blu door and window sensor

2 Upvotes

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 • • Jul 05 '24

Django AI Assistant - Open-source Lib Launch

2 Upvotes

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:

  1. Try It: https://github.com/vintasoftware/django-ai-assistant/

  2. ▶️ Watch the Demo

  3. 📖 Read the Docs

  4. Test It & Break Things: Integrate it, experiment, and see what works (and what doesn’t).

  5. 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 • • May 04 '24

/r/PythonCoding monthly "What are you working on?" thread

2 Upvotes

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 • • Apr 30 '24

ffmpeg takes too long on mac

Thumbnail self.ffmpeg
2 Upvotes

r/pythoncoding • • Apr 21 '24

Searching OEIS tables

Thumbnail
paddy3118.blogspot.com
2 Upvotes

r/pythoncoding • • Apr 12 '24

I implemented the Seam Carving algorithm for fun! So, I decided to create a video explaining the magic behind this image processing technique 🪄

Thumbnail
youtube.com
2 Upvotes

r/pythoncoding • • Mar 27 '24

The weird quirk with rounding in Python

Thumbnail
medium.com
2 Upvotes

r/pythoncoding • • Feb 21 '24

Command pattern

2 Upvotes

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 • • Feb 18 '24

Streamline memory usage with the __slots__ variable

Thumbnail pynerds.com
2 Upvotes

r/pythoncoding • • Feb 17 '24

[Video]List Comprehension in Python - What and How to use it with examples

2 Upvotes

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 • • Jan 16 '24

Trying to make a calculator

2 Upvotes

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 • • Jan 14 '24

[Questin] not sure what library to use for gui with moving elements

2 Upvotes

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 • • Nov 20 '23

My text editor open source project (documented better now)

Thumbnail self.python
2 Upvotes

r/pythoncoding • • Nov 20 '23

If the payoff of ensuring best practices is not immediate, is it worth doing it in semi-high-stakes situations?

2 Upvotes

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 • • Nov 13 '23

Advice wanted! Best online interactive plotting app/platform to collect time series data of clicked coordinates??

2 Upvotes

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 • • Nov 04 '23

/r/PythonCoding monthly "What are you working on?" thread

2 Upvotes

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 • • Oct 30 '23

Troubleshooting Python with OpenTelemetry Tracing

Thumbnail signoz.io
2 Upvotes

r/pythoncoding • • Oct 25 '23

What bg music would you enjoy on a documentry/case study type python YouTube channel

2 Upvotes

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

  1. Short Python videos (60 second long)

  2. GNSS and Signal Processing

  3. 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 • • Oct 20 '23

Multi-vendor architecture: Merging Low-Code and Python RPA for Optimal Automation in 2024 - RPA Master

Thumbnail
rpamaster.com
2 Upvotes

r/pythoncoding • • Oct 19 '23

Need early review on my small pygame project

Thumbnail self.pygame
2 Upvotes

r/pythoncoding • • Oct 14 '23

Wuddz-Crypto Transfer Bitcoin Or TRC10/20 Tokens, Create Crypto HDWallet, Get Prices & Balances

2 Upvotes

Cool Nifty Cryptocurrency CLI Program To Check Balances, Transfer Crypto & Generate Secure Crypto Wallets.
wuddz-crypto


r/pythoncoding • • Sep 29 '23

Challenges with Selenium and EdgeDriver in Python

2 Upvotes

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":

  1. Navigate to the website.

  2. From a dropdown menu, select "Leitzersdorf (Korneuburg)".

  3. Click the "Fertig" button.

  4. 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