Category "python"

Python Asyncio/Trio for Asynchronous Computing/Fetching

I am looking for a way to efficiently fetch a chunk of values from disk, and then perform computation/calculations on the chunk. My thought was a for loop that

C# with Iron python Error: Microsoft.Scripting.SyntaxErrorException: 'unexpected token 'from''

I'm trying to execute a python file in c#. But I'm getting an error when I'm trying to execute the python file. The error is Microsoft.Scripting.SyntaxErrorExce

JSON input to multiple excel file outputs

I have a JSON file that looks like this: { "Person A": { "Company A": { "Doctor": { "Morning": "2000", "Afternoon": "1200" },

python passing function variables to another function

I am trying to pass a variable from one function into my main engine function in a separate file. I have looked up other answers and gone through some but I can

more concise way to make this?

I'm unsure of how to create a certain section of my code without it being excessively long and tedious. Is there perhaps a way of utilizing a range function whe

How to mount a bigger file to docker compose

The issue is as long as the file size is small: I could mount the volume and see it inside my container. But as the file size grows let's say 34MB, I can't see

Deploying a chatbot written with the Flask framework

I have created basic chatbot using FLASK framework and Python. This will create a default URL http://127.0.0.1/5000. Below link is similar to my chatbot. ex: h

How to identify whether an item inside ZipFile is a directory

Consider a zip file that contains a directory with some files inside, e.g. contents of sample.zip are: Archive: ziptest.zip Length Date Time Name

Django. How to get URL by its name?

I want to get url by name specified in urls.py. Like {% url 'some_name' %} in template, but in Python. My urls.py: urlpatterns = [ ... path('admin_secti

How to send table dropdown select fields to flask

I have a table composed of three columns, a text and two other select fields. When the user chooses an option from the dropdown select, I would like to send the

I keep getting an error when with tronpy trc20 token transaction - FIXED

I keep getting this error whenever I try to send an trc20 token transaction with tronpy Traceback (most recent call last): File "/home/pgolphri/virtualenv/fla

Flask not running properly [duplicate]

I am trying to get started on flask but have some teething issues... In the terminal I am using the commands: > set FLASK_APP=hello.py >

How to join two columns with lists into column with nested lists?

I have a dataframe: v1 v2 [1,2] [4,5,6] [1,1,5] [4,5,6,7] I want to join them into column with nested lists: v1 v2 v3 [1,2]

Suppress printing of response from Azure Queue Storage

When I send a message to a queue I want the response returned into an object which I can then include in my log or not. However for some reason when I execute t

Vercel CLI Pyhon version issue when deploying Django project

When running the vercel command in Ubuntu terminal: Error! Command failed: python3.6 /tmp/2de7da56/get-pip.py --user ERROR: This script does not work on Pyth

regular expression to return the uppercase message in parenthesis, after the process id

I want the extract_pid function to return the uppercase message in parenthesis, after the process id. Following code is printing pids but not sure how to add ca

Read latest image file from folder

from pickle import NONE import cv2 import numpy as np import easyocr import glob import os import mysql.connector import datetime, time def load_image():

Write a program using integers user_num and x as input, and output user_num divided by x three times

Write a program using integers user_num and x as input, and output user_num divided by x three times. Ex: If the input is: 2000 2 Then the output is: 1000 500

How to optimise reading multiple files containing bytes into a NumPy array

I currently have ~1000 files containing bytes. Each file contains a few thousand messages, each message has identical data types. I've tried several ways of rea

Why is the Python Requests Module not returning links?

So I had created a python web scraper for my college capstone project that scraped around the web and followed links based on a random selection from the page.