Category "python"

How to plot a streamplot in python for a streamline flow arround a cylinder?

I have written a program where it takes a radius range(R to 5) and theta range(0 to 2pi). It converts the polar coordinates to Cartesian coordinates. Then I hav

Failed building wheel for Pillow Command on cPanel

The first issue I had was I needed to upgrade pip to the latest version. Once I did that I was able to run pip install pillow however I get the following error.

Pyqt5-tools installation error on Widows 11

Downloading when I downloaded Pyqt5. But when I try to download Pyqt5-Tools, I'm getting an error. I using Windows 11 When using Windows 10, it was easily downl

'pipenv install <package>' fails on fresh python3.10 installation

Just installed a fresh copy of Python3.10 via Pop OS, followed by pip and the python Pipenv package. Installing pip packages works fine globally, but if I try t

How to read exif metadata from jpg file using only python, without any library?

I am trying to extract exif metadata from jpg file but hit a wall in between. I am following this( https://www.w3.org/Graphics/JPEG/jfif3.pdf ) but not sure if

How to fix the error: takes 1 positional arguments but 2 were given?

Problem: I would like to fix the error below. f() takes 1 positional arguments but 2 were given My code: import math delta_x = 0.001 def integrate(func, z, w)

python this gpiozero method is not working right of the bat

from gpiozero import MotionSensor While true: MotionSensor(17).when_motion() print("motion detected") returns error: Traceback (most recent call last

Flask restful api with mysql backend crashes when more than 2 apis are called from angular app

We are working on a test project and really do not know Flask and Flask restful much. Our python is not good as well, the problem is, we have developed an API s

Hashing gives different result

I am using Python and MySql to handle user authentication. I have added the users thru python with the exact same method, but when I try to do the "login"/authe

Scene Text Image Super-Resolution for OCR

I am working on an OCR system. A challenge that I'm facing for recognizing the text within ROI is due to the shakiness or motion effect shot or text that is no

Why is my Pytorch code significantly slower than Tensorflow?

I am trying to move my code from Tensorflow to Pytorch. Before doing this, I just simply test myself two frameworks. I expected two frameworks should show simil

Converting windows paths to pathlib.WindowsPath() within a function in python

Edited for clarity I need to be able to copy and paste a windows path directly from file explorer into a function which turns it into a pathlib.WindowsPath() ob

Unexpected errors happen on working script

I'm relatively new to python and only recently tried some small scripts with it that can be used for my needs (just simply interact and automate with some parts

use function to the items in list

originally, beaker is instance and the function below is possible. beaker.replace(z=10) I made a list of beakers bk = [beaker1, beaker2, beaker3] and I want al

ImportError: cannot import name '...' from partially initialized module '...' (most likely due to a circular import)

I'm upgrading an application from Django 1.11.25 (Python 2.6) to Django 3.1.3 (Python 3.8.5) and, when I run manage.py makemigrations, I receive this messasge:

'NoneType' object has no attribute '_inbound_nodes'

I have a code to forecast a time series using an attention mechanism. Here's what I've got so far, but I'm getting an error. def dot_product(x, kernel): if

Performing Excel formula in Python

import numpy K = 1 Rmv = 26 SigS = 111.7 M = 2.050 N = 2 SigD = (-249.4) def Mittelspannung(): result = [] Y = [] SigM = [] for i in rang

TypeError: color must be int or single-element tuple

Here is the error encoutered: TypeError: color must be int or single-element tuple Here is the code I am running: from PIL import Image from PIL import ImageD

How would I run a while loop on a separate thread in Python?

I'm new to coroutines in python but I know in lua you would do this to create one coroutine.wrap(function() while true do end end)() But I dont know how I wo

input() error - NameError: name '...' is not defined

I am getting an error when I try to run this simple script: input_variable = input("Enter your name: ") print("your name is" + input_variable) Let's say I type