Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 13921 articles
Browse latest View live
↧

How do I make the code ask me to choose the folder I want to save a file in?

import osimport tkinter as tkfrom tkinter import filedialogdef add_numbers(): attempts = 0 results = [] while attempts < 3: try: num1 = float(input("Enter the first number: ")) num2 =...

View Article


Image may be NSFW.
Clik here to view.

cdo remapdis (Abort): proj library support not compiled in

sea ice drift data: https://nsidc.org/data/nsidc-0116/versions/4I try to resample this data into longitudexlatitude=r720x361 grid, so I tried cdo remapdis command:and then I check my cdo library, and...

View Article


Migrate PostgresDsn.build from pydentic v1 to pydantic v2

I have simple Config class from FastAPI tutorial. But it seems like it uses old pydantic version. I run my code with pydantic v2 version and get a several errors. I fix almost all of them, but the last...

View Article

How to get all Payment Methods with Facebook API

How to get payments methods for Facebook ads account?I don’t have any business manager and want get payments methods with api? How to do that?I am tried funding_source but this return none.In my...

View Article

How to run an iteration when you click mouse or keyboard

In the loop below, I want to add mouse/keyboard click action that stop the loop. And when I click again, the loop resume.Can you please help?import timefor i in range(10): print(i) time.sleep(2)

View Article


Implementing a Custom Loss Function in TensorFlow for Regression Problem with...

I am working on a regression problem using TensorFlow, where I have encountered a challenge with my loss function. My data points are structured as triples $(Y_i, G_i, X_i)$, where$Y_i \in \mathbb{R}$...

View Article

No module named openai

I've installed openai on my laptop with pip install openai.Have installed on my laptop and after installed on the same folder where my code file is. But when I try to run the code I get ImportError: No...

View Article

_tkinter.TclError: couldn't read file...

I have used Sun Valley Ttk Theme for my project (.py). It works on IDE (Thonny) but doesn't work when I converted the .py file to .exe.I got this error for the line:...

View Article


Pyodbc Update SQL Server script not updating

I am trying to run a simple SQL Server update script through Python pyodbc but when executing the python script, it's not making the update for some reason and I can't find the cause as it does not...

View Article


Error when trying to extract text from word using python?

I'm currently trying to write a function in Python that will allow me to extract text from .docx files. For this I use the python-docx library. My program also does what it's supposed to do, at least...

View Article

Created this hangman game as one of my early projects as I'm still a beginner...

When I run my code in the terminal in vscode, instead of there appearing dashes(-) to display the certain amount of letters in the word there aren't any and it instead asks me to type a letter. Not...

View Article

StaleElementReferenceException: how to make it wait longer?

I'm trying to write an automated messages. The issue is, it takes a bit longer to write the message and then it gets the StaleElementReference error.the error happened when it is trying to clear the...

View Article

Add dropdown menu (nested list) to Google Spreadsheat with gspread / Google...

I am struggling to insert a dropdown menu into a Google Spreadsheet using the gspread module in python.This question explains how to get a dropdown menu in a spreadsheet:How to add a nested list with...

View Article


Accessing nested element using beautifulsoup

I want to find all the li elements nested within <ol class="messageList" id="messageList">. I have tried the following solutions and they all return 0 messages:messages =...

View Article

Python code to find First day of month is business day then week number is...

If following is true, then week_num should be 9.Week_num M T W T F S S10 29 30 31 1 2 3 4If 1st of given month is weekend the week_num = week_num.Thanks in advance.Ive tried the python business day...

View Article


Select item inside a react-select dropdown list in Selenium with Python

Link example website hereIn that website, I am looking how to select item (e.g "Green") in "Single" dropdown box and "Grouped" dropdown box.I tried to click to dropdown first and tried to find the...

View Article

Instaloader: JSON Query to explore/tags/hashtag/: 404 Not Found

I am constantly getting an error where when I try to scrape posts from a specific hashtag using instaloader, I am getting the error: JSON Query to explore/tags/hashtag/: 404 Not FoundHere is my...

View Article


python subprocess.run with awk failing [duplicate]

My function:def run(cmd = ""): sp = subprocess.run(shlex.split(cmd), shell = False, capture_output = True) pprint(sp) print(sp.stdout.decode("utf-8", 'ignore'))This function was working normally. Then...

View Article

How to use ssh with python on windows without paramiko?

On machine A I want to have a small python script to execute a command on machine B. Machine A is Windows with freesshd running on it, and machine B can be either Windows or Linux. I only have a...

View Article

PyQt5 WebEngine does not display pages like angular.dev or react.dev properly

I can't figure out how to make pages like react.dev, angular.dev, facebook.com, or chat.openai load properly.from PyQt5.QtWidgets import *from PyQt5.QtGui import *from PyQt5.QtCore import *from...

View Article
Browsing all 13921 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>