Category "python-3.x"

Problem with obtaining GET all athlete activities in Strava API v3

I would like to access my own activities using the Strava API in Python. I've researched the responses to the question below, but am still bumping into errors.

Python-Classes and Objects

import random suits = ('Hearts', 'Diamonds', 'Spades', 'Clubs') ranks = ('Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Jack', 'Queen'

How to send message followed by start to a bot by link using telethon?

I want to interact with a bot which takes chat id and message id and replies based on the message of that chat id. Usually I interact with the bot in a group ch

Resizing terminal window with python on linux

I have been unable to find a way to resize the terminal running linux with python 3.x I am on "Raspbian GNU/Linux 9 (stretch)" I have only found ways to escape

EOF command not working with netcat python program

I tested below code with kali and ubuntu and am getting the same error where CTRL-D is not recognized as EOF, this is following the book black hat python 2nd ed

How to copy folder having files, also having sub-folders with different files to aws S3 bukcet with same folder level structure using python language

Hi all can you please help to figure out this issue How to copy a folder having py files, and aslo having sub folder level files which are present in a particul

Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] for Python 3.9

I am trying to install Python 3.9 in order to access some updated libraries compared to Python 3.6. However, when I run my code, none of the previous libraries

How to Group by Date Field in a PivotTable using win32com.client

I tried many approaches from last few hours but no luck. Somebody please help me. group_dt = pt.PivotFields('Created') group_dt.LabelRange.Group(Start=True, End

Read csv from Azure blob Storage and store in a DataFrame

I'm trying to read multiple CSV files from blob storage using python. The code that I'm using is: blob_service_client = BlobServiceClient.from_connection_string

Openpyxl: Decode 'auto' color to rgb value

I am trying to determine the color of borders set in an Excel document. I use the 'openpyxl' library (latest Version 3.0.9) and encountered a problem to extract

Hugginface transformers module not recognized by anaconda

I am using Anaconda, python 3.7, windows 10. I tried to install transformers by https://huggingface.co/transformers/ on my env. I am aware that I must have eith

Pygame cannot make image bigger over time

I am trying to make an image get bigger over time for a cool effect. I've tried using this: import pygame from pygame.locals import * pygame.init() class Ima

How to Access Postgres Service from Child Docker Container in Gitlab-CI? How do I access IP address of postgres service or gitlab shared runner?

I have setup a gitlab-ci build with the architecture illustrated below. (source: gitlab.com) . The listener container is unable to communicate with the postgres

matplotlib savefig of multiple subplots without displaying

I have an array of images which I have reshaped as size (28, 28, 3) of 100 images. I want to save the plot which the below code generates, but without display

How to update json file sorted by number? - Python

For example I have a JSON file with a mess number { "data": { "31": { ... }, "52": { ... }, "

Whitelisting Apps on Windows Defender using Python

As the title says, I was wondering if there was any way to whitelist apps automatically, like how Salad (from https://salad.com) does it, using Python.

ValueError: Ran into a $end where it wasn't expected - RPLY Parsing

I'm trying to create a parser for a basic interpreted language. When I run my program I get the following error: ValueError: Ran into a $end where it wasn't exp

How to allow extraction of all files even the ones with same name?

I'm struggling with unzip process with this code: I have two separated .zip files and each has the same file name and file type, but when I execute this code on

Messenger bot send a message every 5th message

I am making a simple bot for messenger on python using fbmq, that handles quick questions. I made bot to send a message when users text to my Facebook page ou

ModuleNotFoundError: No module named 'tensorflow.python.eager' when loading Sequential model

When attempting to import Sequential from keras.models, I get the error shown below. I have already uninstalled and reinstalled tensorflow through PIP, but am n