October 22, 2024
Chicago 12, Melborne City, USA
python

Why is the Python mulitprocessing using class functions slower than in serial for this code?

I am trying to run a multiprocessing pool within a class to calculate several values that use class functions of a much larger class. I am trying to take the initial values and add a random 5% normal distribution to each value and calculate the new log likelihood of those new values. Here is a

Read More
python

How to fix this pygame menu UI?

This is setting up the class to show the main menu class CreatePlayer: def __init__(self, screen, width, height): self.screen = screen self.width = width self.height = height self.country_name="" self.flag_color_1 = self.random_color() self.flag_color_2 = self.random_color() self.symbol_color = self.random_color() self.pattern = 'Stripes' self.shape="Circle" self.shape_size = 50 self.shape_position = (self.width // 2, self.height // 2) self.makes = []

Read More
python

Looking for Insights on Tagmango Python Course Success

I am an experienced Python developer and working professional. I’ve been providing one-on-one python tutoring across several online platforms. I would like to know if anyone has successfully gained good clients by launching a Python course using Tagmango. Additionally, I have some specific questions: Course Structure and Content: What topics did you include in your

Read More
python

Not receiving gps data from PT06 gps tracker device

I am trying to connect with PT06 gps device (https://pictortelematics.com/products/bike-gps-tracker/pt06-gps-tracker) using socket through python. I am able to make an successful GPRS connection with the gps device and it is sending me the login details (Landing Packet), from that I can extract all the values correctly. Now for the acknowledgement, I am sending an server

Read More
python

What is the `𝜋thon` executable?

On Ubuntu or other Linux-based systems, Python 3.14’s venv creates an extra executable named 𝜋thon: $ python --version Python 3.13.0 $ python -m venv .venv $ cd .venv/bin && ls Activate.ps1 activate activate.csh activate.fish pip pip3 pip3.13 python python3 python3.13 $ python --version Python 3.14.0a1+ $ python -m venv .venv $ cd .venv/bin && ls

Read More
python

Can someone suggest some college project ideas for Computer Science

I’m a Bsc. Computer Science student and I’m trying to create a project solo. I’ve been getting rejections and now I don’t have a clue what to make and I got to submit an idea soon. I tried to code voting system using Blockchain but it isn’t going really well,and I also tried to create

Read More
python

devcontainer: pylance issue

I have the following folder structure workspace │ docker-compose.yml │ Dockerfile │ ├───.devcontainer │ devcontainer.json │ └───app __init__.py main.py Dockerfile FROM python:3.9 docker-compose.yml version: '3.8' services: app: build: context: . dockerfile: Dockerfile container_name: app environment: - PYTHONDONTWRITEBYTECODE=1 volumes: - .:/workspace:cached command: sleep infinity devcontainer.json { "name": "app", "dockerComposeFile": "../docker-compose.yml", "service": "app", "workspaceFolder": "/workspace", "customizations": {

Read More
python

Selenium AWS Python 3.12 – How to Get in a Layer for Lambda Functions

I’ve been working on using Selenium with Python 3.12 in an AWS Lambda layer. While I’ve successfully set this up using Docker, I’m curious if it’s possible to achieve the same with a Lambda layer. I’ve spent hours trying to design a layer that includes Chrome, Chromium, and the necessary packages. However, I’ve run into

Read More
python

What does ''' mean in Python?

Have been told that in Python ''' is used to indicate the start of a multi-line string. However I have also been taught that this code also allows for the documentation of functions and modules. Googling, surprisingly, doesn’t give a clear answer on what ”’ definitively refers to. So how should I remember, as a

Read More
python

How to split my dataset into Test and Train without repitition?

I am developing a Python script to test an algorithm. I have a dataset that I need to split into 80% for training and 20% for testing. However, I want to save the test set for further analysis, ensuring no overlap with previous test sets. Although my code works well overall, I encountered one issue:

Read More