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

Tkinter touchscreen taps only works when mouse hovering in window

I am using Tkinter for my camera's control to tweak shutter speed and analog gain. I am able to tweak both settings via mouse and take pictures using a button via GPIO.After testing on my touchscreen...

View Article


How can I infer return type for object based on parameter?

Let's say we have a functiondef get_attr_wrapper(obj: object, attr: str) -> ???: return getattr(obj, attr)How can I infer the return type of get_attr_wrapper based on the parameters given?Maybe with...

View Article


Python : Getting current Bitcoin price from Yahoo finance with yfinance module

I'm trying to read and display the current Bitcoin market price in Python, using the yfinance module/library. It works fine for currency pairs or market indices but BTC-USD doesn't seem to have any...

View Article

Image may be NSFW.
Clik here to view.

Using matplotlib and pandas to make a bar chart

I have a bunch of data that I am trying to plot as a bar chart for each lithology. I would like the Y-axis to be the percent of each RQD Bin for each lithology, rather than the total length. I know...

View Article

Why does the random.choice() module not work in vscode? [closed]

I am trying to create a bingo card generator, but while I was testing it a ran into a problem. When the I use the random.choice() module to generate a random number it returns the following...

View Article


Cant run python program

def decideReward(points): if not(isinstance(points, int)): decision = "invalid" print("Invalid input! You should provide an integer!") return decision if points < 0: decision = "invalid"...

View Article

How to tag words that not include one specific symbol in Spacy?

I'm trying to tag one word in Spacy using regex, but I want to add one condition: it can't contain symbol '/' in any place inside. My code looks like this:[{'lower': {"regex": "^.*(word).*?"}}]I tried...

View Article

how to find and replace and add new string from particular position either...

I have a string with is required to replace multiple places and add new string from particular position.Input is[(stack_overflow('abc','xyz')\n stack_overflow_is_used_for_queries('defgh','mnopq')\n...

View Article


Group by on entire dataframe vs group by on subset of columns of dataframe

I'm working in a codebase where I see a lot of groupby usage like this that operates on a subset of the columns of dfdf[cols].groupby(some_column).nunique()[column2extract]where cols includes...

View Article


Throughput Measurements of Custom Network device using Linux and Python3

I have a custom network device that has 2 ethernet interfaces. It can receive UDP messages on either interface as well as a custom experimental protocol as well on both interfaces. Once it receives a...

View Article

Is asyncio in Python user-level threading model, cooperative scheduling?

I have been working for a long time with asyncio in Python, however I would like to clarify some thoughts on how asyncio actually works. I will break down my thoughts so that I can give context and...

View Article

Is there a way to wait until a condition is true in python tkinter

I made a program where one must enter a string into an entry box. After one clicks the enter button, the program will get the string from the entry box and combine it with another string to create a...

View Article

O365 SMTP Actively refuses subsequent connections

I am attempting to set up a simple webhook application to receive requests and send off an email based on the payload. The libraries in use are smtplib for SMTP, flask for hosting, and ngrok for...

View Article


Efficient method to calculate the rank vector of a list in Python, handle ties

I'm looking for an efficient way to calculate the rank vector of a list in Python, similar to R's rank function. In a simple list with no ties between the elements, element i of the rank vector of a...

View Article

Your request of 5143.88 meters per pixel exceeds the limit 1500.00 meters per...

I am getting the error . I am using sentinelapi to download images from sentinel 2 l2a .The user draws polygons in the frontend from the map. (it is using leaflet). I am getting the error and I don't...

View Article


AttributeError: 'NoneType' object has no attribute 'text'. while Web scraping

I get the following error when trying to AttributeError: 'NoneType' object has no attribute 'text' import requests from bs4 import BeautifulSoup import numpy as np headers = {"User-Agent": "Mozilla/5.0...

View Article

Python MDanalysis package: PermissionError: [Errno 1] Operation not permitted

I'm trying to load my Molecular Dynamics trajectories (.nc Amber file format) into Python using the package MDAnalysis. I'm using the following code: clusters = 1085 list_trajectories = [] for i in...

View Article


Image may be NSFW.
Clik here to view.

ModuleNotFoundError: No module named 'tensorflow_hub'

I followed instructions given in the TensorFlow website to install tensorflow_hub and installed it within a conda environment.$ pip install "tensorflow>=2.0.0"$ pip install --upgrade tensorflow-hubI...

View Article

Spacy textcat multilabel config validation error

I am trying to train a spacy textcat_multilabel model. I thought I had everything set up correctly, but I continue to get a validation error.This is the label section of my...

View Article

How can i Modify a data file that is contained inside a One File Pyinstaller...

I am using the command pyinstaller -F --add-data="token;." Main.py for my code.i want to be able to change the contents of the token file and it stay like that after i rerun iti tried to modify the...

View Article
Browsing all 13951 articles
Browse latest View live


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