r/pythonhelp • • Jan 30 '26

CV2 face tracker assistance

Thumbnail reddit.com
0 Upvotes

r/pythonhelp • • Jul 24 '25

[HSLP] not able to import module

0 Upvotes

I am trying to import module like pandas,and matplotlib but it's not working. Even in IDLE it shows syntax erroor.

FYI I have installed python in a different drive other than main drive I.e. not local drive C. How can I import the modules?? And also not working


r/pythonhelp • • Feb 26 '26

Problem with my python3 discord bot

Thumbnail reddit.com
0 Upvotes

r/pythonhelp • • Jan 30 '26

Django Orbit: A lightweight, open-source observability tool for Django

Thumbnail reddit.com
0 Upvotes

r/pythonhelp • • Mar 11 '26

i just want to learn pyfltk

Thumbnail reddit.com
0 Upvotes

r/pythonhelp • • Feb 10 '20

i keep getting errors when using selenium webdriver (firefox)

0 Upvotes
from selenium import webdriver

driver = webdriver.Firefox()
driver.get('https://google.com/')

the error i get is:

Traceback (most recent call last):
  File "c:/Users/me/Desktop/coding/PYTHON/kahoot/test.py", line 3, in <module>
    driver = webdriver.Firefox()
  File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 174, in __init__
    keep_alive=True)
  File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\me\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

thanks for your time

software

selenium webdriver

gekodriver 0.26.0

firefox 72.0.2


r/pythonhelp • • Oct 02 '19

Taking the max values of y in binned intervals of x.

0 Upvotes

This is specifically for reducing mess in a scatter plot consisting of two lists. Say for every 0.3 value of x I only want 1 y value.


r/pythonhelp • • Dec 06 '19

python assignment help

0 Upvotes

need someone to help me with my final python assignment :/ pls help i want to graduate


r/pythonhelp • • Feb 09 '20

Having a hard time getting python to understand my keys.

Post image
0 Upvotes

r/pythonhelp • • Dec 05 '18

Why is list index 'x' out of range (ignore comments)

Post image
0 Upvotes

r/pythonhelp • • Jun 23 '22

INACTIVE For loop append

0 Upvotes

We have a data frame we are fetching in a for loop.

csv file one

0,1

0,player-x, 3565

0,Home, Kenya

csv file two

0,1

0,player-y, 3245

0,Home, Netheland

I want to append like this

Index,Player name,Home

0,player-x, 3565, Kenya

1,player-y, 3265, Netheland

Also, In my code I was unable to change the Index in the stored for loop, Please ask questions.


r/pythonhelp • • Jun 15 '22

Why my program doesn't display or have those two buttons despite my code being exactly the same as this guy on Youtube by using the same editor as well?

0 Upvotes

Hi, I'm trying to make this application from a video on Youtube called "Build A Python GUI App Tutorial" by Dev ed. However, it doesn't show me the buttons. I have also tried it with other IDE's too!

Build A Python GUI App Tutorial - YouTube

import tkinter as tk
from tkinter import filedialog, Text
import os

 
root = tk.Tk()
apps = []

if os.path.isfile('save.txt'):
with open('save.txt', 'r') as f:
        tempApps = f.read()
        tempApps = tempApps.split(',')
        apps = [x for x in tempApps if x.strip()]

def addApp():
for widget in frame.winfo_children():
        widget.destroy()

    filename= filedialog.askopenfilename(initialdir="/",title="Select File",
                                         filetypes =(("executables","*.exe"), ("all files", "*.*")))

    apps.append(filename)
    print(filename)
for app in apps:
        label = tk.label(frame, text=app, bg="gray")
        label.pack()

def runApps():
for app in apps:
        os.startfile(app)

canvas = tk.Canvas(root, height=700, width=700, bg="#263D42")
canvas.pack()

frame = tk.Frame(root, bg="white")
frame.place(relwidth=0.8, relheight=0.8, relx=0.1, rely=0.1)

openFile = tk.Button(root, text="Open File", padx=10, pady=5, fg="white", bg="#263D42", command=addApp)
openFile.pack()

runApps = tk.Button(root, text="Run Apps", padx=10, pady=5, fg="white", bg="#263D42", command=runApps)
runApps.pack()

for app in apps:
    label = tk.Label(frame, text=app)
    label.pack

root.mainloop()
with open('save.txt', 'w') as f:
for app in apps:
        f.write(app + ',')


r/pythonhelp • • Jul 11 '22

input validation, while loop

0 Upvotes

# Code below, attempting to check input validation for user, I was able to make sure value > 0

# however, if user doesn't enter anything or enters a string, I get a traceback error

# Any advice on how to fix this?

resistances = [12, 13, 81, 56, 39, 27, 5, 16]
currents = []
powers = []

for resistance in resistances:
temp = eval(input("Enter a current: "))
while temp < 1:
print("Error, current number has to be greater than 0.")
temp = eval(input("Enter a current: "))
currents.append(int(temp))
powers.append(currents[-1] * currents[-1] * resistance)

bundle_number = zip(resistances, currents, powers)
sorted_numbers = sorted(bundle_number)

# print(sorted_numbers)
print()
print("\t", "Resistance", "Current", "Power", sep="\t")
print("\t", "----------", "-------", "-----", sep="\t")
print()
for (resistance, current, power) in sorted_numbers:
print("\t", resistance, current, power, sep="\t\t")
print("\t", "----------", "-------", "-----", sep="\t")
print("Totals:", sum(resistances), sum(currents), sum(powers), sep="\t\t")


r/pythonhelp • • Jun 14 '22

Python macOS GUI programming is broken af at the moment

0 Upvotes

Here's the current state of GUI programming on Python in macOS:

  • The default version of Tkinter that is installed with macOS Python is now horribly broken. Tkinter runs, but the window is completely black.

  • All versions of Python that are installable via pyenv do not include tkinter, and so use the horribly broken native version.

  • tkinter cannot be updated via pip.

  • tkinter cannot be updated via brew.

  • The primary recommendation for fixing tkinter is to rebuild Python from source with a bunch of hacked instructions to fix tkinter. The instructions are long, painful, and dubiously reliable.

  • The secondary recommendation to fix Tkinter is to install ActiveTcl from ActiveState. ActiveState won't give you ActiveTCL unless you create an account. Your account must have a valid email address. You must verify your email address to continue. Now that you have created an account and logged in and verified your email address, you still can't fucking download ActiveTCL because you instead need to create a project on the ActiveTcl web IDE that uses ActiveTCL and then download an entire ActiveState platform, which, by the way, do you know you're using a free community account and you should upgrade to a paid account?, and and and and...

  • PyQt is not downloadable via brew.

  • PyQt might be installable via pip, but fails horribly:

    AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
  • The main recommendation to fix PyQt is to pip install pyqt-sip first. This official page read: "The SIP installation instructions can be found at http://pyqt.sourceforge.net/Docs/sip4/installation.html." That hyperlink leads to a 404 page.

  • This StackOverflow page has a bunch of recommendations for compiling PyQt from source. Every recommendation includes complaints that it didn't work for some people.

  • You can also download the official Qt installer, which is a massive bloated package. But first please create an account, and enter an email address, and validate your email address, and and and and...

  • The tertiary solutions involve a bunch of dodgy packages that haven't been updated since like 2017.

Python community. Seriously. How can basic GUI programming be this badly fucked up? Where trying to get a single goddamn GUI window requires recompiling Python from source and/or providing a verifiable email address to some third party so they can spam me with shitty offers for paid services?!

Get. your shit. together.


r/pythonhelp • • Jun 06 '22

FizzBuzz Problem

0 Upvotes

Hello,

I am struggling with a practice FrizzBuzz problem.

def StringChallenge(num):
    for i in range (1, num+1):
        if(i % 5 == 0 and i % 3 == 0):
            print("FizzBuzz", end = ' ')
        elif(i % 5 == 0):
            print("Buzz", end = ' ')
        elif(i % 3 == 0):
            print("Fizz", end = ' ')
        else:
            print(i, end = ' ')
            
    return num
print(StringChallenge(input()))

I am trying to make it work so it all outputs on the same line. The first line and last two lines are required.


r/pythonhelp • • Jun 05 '22

Assistance with an output, please!

0 Upvotes

Hello, Can anyone help me with how to achieve this output:

Enter a number of seconds: 11730

Here is the time in Hours, Minutes, and Seconds:

Hours: 3.0

Minutes: 15.0

Seconds: 30.0

**We were provided this tip:

hours = yourVariable //3600

minutes=(yourVariable//60)%60

seconds=yourVariable%60


r/pythonhelp • • Jun 01 '22

I want to make a window using the tkinter import but it says "window = tkinter() TypeError: 'module' object is not callable"

0 Upvotes

import tkinter
window = Tk()
window.mainloop()


r/pythonhelp • • Jun 01 '22

HOMEWORK University Coursework

0 Upvotes

Hello all, is anyone able to help me with my python programming coursework. It is based off booking a seat at a theatre and involves creating functions and tables which I am lost on. Would anybody be willing to lend a hand it would be greatly appreciated?


r/pythonhelp • • Jun 28 '23

Another text based game question. Hopefully my last one.

Thumbnail self.learnpython
0 Upvotes

r/pythonhelp • • Jun 26 '23

python snake game game height not defined?

0 Upvotes

I am making a snake game,but it gives me a name error that reads "line 56, in <module>
y = int((screen_height/2) - (window_height/2))
NameError: name 'window_height' is not defined"

here is my code:

from tkinter import *
import random
GAME_WIDTH = 700
GAME_HEIGHT = 700
SPEED = 50
SPACE_SIZE = 50
BODY_PARTS = 3
SNAKE_COLOR = "#00ff00"
FOOD_COLOR = "#ff00ff"
BACKGROUND_COLOR = "#000000"
class Snake:
pass
class food:
pass
def next_turn():
pass
def change_direction(new_direction) :
pass
def check_collisions():
pass
def game_over():
pass
window = Tk ()
window.title("snake game")
score = 0
direction = 'down'
label = Label(window, text="score{}".format(score),font=('consolas', 40))
label.pack()
canvas = Canvas(window, bg=BACKGROUND_COLOR, height=GAME_HEIGHT, width= GAME_WIDTH)
canvas.pack()
window.update()
window_width = window.winfo_width()
window.height = window.winfo_height()
screen_width = window.winfo_screenwidth()
screen_height = window.winfo_screenheight()
x = int((screen_width/2) - (window_width/2))
y = int((screen_height/2) - (window_height/2))
window.geometry(f"{window_width}x{window_height } + {x} +{y}")
window.mainloop()


r/pythonhelp • • Jun 28 '23

Another text based game question. Hopefully my last one.

Thumbnail self.learnpython
0 Upvotes

r/pythonhelp • • Jun 20 '23

SOLVED Pyinstaller / Auto Py to Exe not importing my custom module

0 Upvotes

So I have a python script that works perfectly in script form. It uses a custom module I created in a sub directory called /modules/ that is called autorun.py,

In my python script it's imported via "import autorun" and before I import all of my modules I also add "sys.path.append('./modules/')" to my code. Like I said, it works great in script form.

But when I use Auto Py to Exe or Pyinstaller and build an exe, that's where trouble starts. When I try to execute my built exe I get the following error:

ModuleNotFoundError: No module named 'autorun'

Ok no problem. Let's use the hidden imports feature. I add autorun to it. I still have the same issue. What am I doing wrong?

Here is the pyinstaller command that auto py to exe generates:

pyinstaller --noconfirm --onefile --console --add-data "C:/py37envshell/py37client/modules;modules/" --hidden-import "autorun"  "C:/py37envshell/py37client/py37client.py"

Also in case anyone suggests it, I am more than happy to throw auto py to exe into the trash and go straight into command line with pyinstaller but even if I use that I still have the same issue as I am trying that above command which isn't importing autorun.


r/pythonhelp • • Jan 07 '24

Top 10 locations that gave the highest average rating for a certain branch.

0 Upvotes

I have a CSV dataset with reviews for 3 Disneyland parks, the headers are; ReviewID, Rating, Year_Month, Reviewer_Location, and Branch. My goal is to display the top 10 locations and their average rating within a bar chart, however, I'm not sure how to get these top 10 locations. I thought about using dictionaries but I couldn't get it to work.

I have no problem with reading the data, it's just averaging out the reviews for each location. If anyone could help me with what I could do to average out these reviews for each location that would be great help. Thanks 🙏


r/pythonhelp • • May 02 '23

Kann mir Jemand bei der programierung dieses Python Idle Programms helfen?

0 Upvotes

Sterben die Deutschen langsam aus? Überaltert unsere Gesellschaft zunehmend? Das sind Fragen, die immer wieder gestellt werden. Um solche Fragen besser beantworten zu können, soll hier die weitere Entwicklung der Bevölkerung in Deutschland mit Hilfe eines Programms simuliert werden.

Die Population ist hier in 4 Altersgruppen unterteilt: die Gruppe der 0-14-Jährigen, die Gruppe der 15-49-Jährigen, die Gruppe der 50-64-Jährigen und die Gruppe der über-65-Jährigen.

Die jeweiligen Übergangs- und Geburtenraten sind dem Diagramm zu entnehmen. Beispielsweise verbleiben 93% der 0-14-Jährigen in einem Schritt (das soll ein Jahr sein) in dieser Gruppe. 6,6% wechseln in die nächste Altersgruppe der 15-49-Jährigen. Zu den 0-14-Jährigen kommen noch 2% der 15-49-Jährigen durch Geburten hinzu.

Als Startwerte sollen die folgenden Angaben (jeweils in Millionen) für das Jahr 2005 benutzt werden:

0-14 Jahre: 12.3 15-49 Jahre: 39.1 50-64 Jahre: 15.5 ueber 65 Jahre: 16.3

Ziel ist es, ein Programm zu entwickeln, mit dem man die Bevölkerungsentwicklung in Deutschland über mehrere Jahre verfolgen kann.