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

How do I make it so that I can detect if two turtles are touching in Python...

I need to be able to make it so that the two turtles "a " and "i" have a collision detection that detects when they touch. Could someone please tell me what lines of code I need to add? I just started...

View Article


Extract information from financial statements from XBRL files in Python?

I am trying to parse and get information from XBRL files, and it seems there are a number of open source packages that have the ability to parse XBRL files in python. However, documentation on using...

View Article


Python 3.12 pip install mod_wsgi fails

I am trying to deploy Django rest framework on my Debian 10 server.I am using Apache2 but he keeps crashing because its not using the right python version.I am using python3.12 version for my project...

View Article

Transpose within Transpose Notepad++?

I have a text file that looks like this (but 132k lines)********name : onePlace : cityInitial: none********name : twoPlace : city2Initial: none********name : threePlace : city3Initial: noneLimits :...

View Article

Image may be NSFW.
Clik here to view.

Parallel programming: Synchronizing processes

I have a program which has a lot of music decks (deck 1, deck 2, music_clip_deck, speackers_deck, ip_call_1, ip_call_2, ip_call_3). Each deck works in a seperate process. The chunk time I use to crop...

View Article


Image may be NSFW.
Clik here to view.

ipywidget to replace Plotly legend item

I am trying to replace the Plotly provided legend with a custom legend using ipywidgets.A simple example is below where I have a checkbox for each trace that can be used to "highlight" the trace from...

View Article

clutter in VS Code output

I m using VS Code connected with anaconda. I m using integrated terminal and in every program i run the output is cluttered with the path and the python execution command as seen below. I m using the...

View Article

How to pivot dataframe in python

I have a dataset that looks like thisStID SubClassID PhOrder PhAmt LbOrder LbAmt4326 200572288 Anti1 23.3 Asprin 13.74326 200572288 Anti2 39.3 Morphin 2.24326 200572288 NULL NULL Medine 30.54326...

View Article


How do I get window focus to switch using "alt+tab" on debian (RPi) with...

I'm working on building a 'thing' (idk what to call it) that has a UI for monitoring certain environmental values and triggers events based on the senors' readings. The readings are also send to a...

View Article


Scrapy Playwright Page Method: Prevent timeout error if selector cannot be...

My question is related to Scrapy Playwright and how to prevent the Page of a Spider from crashing if a specific selector cannot be located.Below is a Scrapy Spider that uses Playwright to interact with...

View Article

Convert complex imperial length into metric units in python? [closed]

How to convert a complex string like this 5' 4 3/4" into a target unit, e.g. mm, in python.As for 5' 4 3/4" a proper result will be 1644.65 mm.

View Article

How to properly inherit from dataclass with base instance re-usage

Consider the following:@dataclassclass Base: prop1: str prop2: str@dataclassclass Derived1(Base): isValid: bool = self.prop2.casefold() == 'valid'@dataclassclass Derived2(Base): isOpen: bool =...

View Article

Error Connecting to Outlook via COM

I have the following python codeo = win32com.client.Dispatch("Outlook.Application")ns = o.GetNamespace("MAPI")profile = ns.Folders.Item("Profile Name")tasks = profile.Folders.Item("Tasks")print...

View Article


I'm having an issue reading onnx file using 'net =...

This is the error I am getting. I was trying to implement yolov7 object detection code using this repo - https://github.com/WongKinYiu/yolov7And I got the yolov7.pt weight file, which is pre trained...

View Article

Importing a deck in anki python

I am working on an addon, for anki, which requires me to import a new deck using its python API. I found the function called test_apkg which seems to have parts which do that. I tried implementing that...

View Article


Issue with converting Kivy app to APK using GitHub Actions

I have successfully converted multiple Kivy applications into APKs using GitHub Actions. However, I recently encountered an issue when trying to convert a new Kivy app. Despite using the same setup and...

View Article

LiveKit: Stream audio and video using python sdk

I am able to stream video but not audio using python sdk . Here is my code to connect to a room and play video (unfortunately no audio). What should I do to also include audio from my video.mp4async...

View Article


KNN algorithm from OCR project having trouble with certain digits (Python)

Im trying to code a OCR project to identify digits without using any extra libraries. Im using Pygame to draw and render the number to identify. I managed to get all of it working, but for some weird...

View Article

random.choice broken with dicts

The random.choice input is supposed to be a sequence. This causes odd behavior with a dict, which is not a sequence type but can be subscripted like one:>>> d = {0: 'spam', 1: 'eggs', 3:...

View Article

ImportError - Unable to Import 'interp' from SciPy Module

I encountered an ImportError while attempting to import PyCaret's classification module:from pycaret.classification import*ImportError: cannot import name 'interp' from 'scipy'This error occurs when...

View Article
Browsing all 16566 articles
Browse latest View live


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