Category "python-3.x"

PytorchStreamReader failed reading zip archive: failed finding central directory

I am trying to learn pytorch from a book, but it seems not a straight line for me. I coped the code below and pasted in my jupyter notebook for running but it g

Simple 2D Perlin Noise in Python

There is lots of different implementations of 2D perlin noise in Python. My question is there a simple implementation of perlin noise in Python that fits in 1 f

write each result of the loop to a python list

I have the txt file as follows: 0 1 2 0 // 7697 909 1 // 3536 4921 2 // 1421 6919 3 * 9805 -8620 4 + -862 -5869 ... ...

checks the text for the presence of 2 or more characters or digits surrounded by parentheses, with at least the first character in uppercase

The contains_acronym function checks the text for the presence of 2 or more characters or digits surrounded by parentheses, with at least the first character in

How to add text annotation to existing PDF using pdf-annotate Python

I'm trying to use this Python library called pdf-annotate to add text annotation to existing PDF files. Here's the documentation of the library: https://github.

How to run google people service build in server to make token.pickle

I try to make micro sever to connect google people API. I do in my local host 'MACOS', everything oke. But after i deploy to server 'CENTOS', server can not ren

How to connect Kafka consumer to Django app? Should I use a new thread for consumer or new process or new docker container?

I have Django app which should consume Kafka messages and handle it with my handlers and existing models. I use https://kafka-python.readthedocs.io/en/master/us

Making a tree form a Dictionary of lists

I'm a new programmer. I am trying to make a Tree from a dictionary that contains all the links between the nodes. Here is an example { 'A': ['B', 'C'], 'B': ['A

Python3 importing files from parent directory / relative importing

I have the following file structure: parentfolder/ utils.py myProgram/ main.py other.py I will be running the main.py which utilizes other.py

Flask check_password always return false

I create login for user in home page if user click on login then the login page is display there user enter email id and password if email id and password is co

Python datetime.now in cygwin console is incorrect

If you could help me understand why: From Cygwin terminal: This is correct: $ date Wed, Sep 2, 2020 11:19:07 PM This is also correct: $ date --utc Wed, Sep 2

PyQt5: how to reimplement close-event in event-filter

I have this Qt Designer made main-window: main.py: from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow):

PRAW Posting new submission with a flair?

Trying to post to a subreddit that requires flairs reddit.subreddit('test').submit(title,url=link,flair_id='') i didn't know how to find the flair_id of a subr

What in this python program can make my memory goes to sky and freeze the program?

I have written a python program that connect to my mqtt server and process the data! BUt the memory start very low and get higher and higher over time! I would

How to partially download a telegram file in with pyrogram

Actually I need to download first few chunks of a file(video/audio/etc) for the sake of mediainfo. pyrogram:https://docs.pyrogram.org/api/methods/stop_transmiss

How to resolve Python mysqlclient install error on Mac

I’m trying to install Python interface to MySQL (mysqlclient 2.1.0) for use with Django project (to be developed in MS Code) on my MacBook with M1 chip. W

An error occurred while packaging. Using pyinstaller

I'm trying to build a python file into a exe file. I don't get it since it builds on some days and gives errors on others. The python script works normally when

asyncio.wait not returning on first exception

I have an AMQP publisher class with the following methods. on_response is the callback that is called when a consumer sends back a message to the RPC queue I se

Cant load spacy en_core_web_trf

As the self guide says, I've installed it with (conda environment) conda install -c conda-forge spacy python -m spacy download en_core_web_trf I have spacy-tra

Automate the boring stuff - Chapter 4: Coin Flip Solution

I am struggling with the solution of the 'Coin Flip' practice project at the end of chapter 4 in 'Automate the boring stuff' for python programming. I have two