Python Forum: Questions and Answers

#проект
#работа
#книга
#урок
#debug
#jupyter
#venv
#pip
#оптимизация
#интервью
#продвинутый
#новичок
#игра
#автоматизация
#базы_данных
#ии
#парсинг
#боты
#веб
#asyncio
#tkinter
#requests
#matplotlib
#pandas
#numpy
#flask
#django
#python3
#python2
#совет
#обсуждение
#пример
#ошибка
#помощь
#вопрос
#python
#метакласс
#асинхронность
#многопроцессорность
#многопоточность
#контекстный_менеджер
#assert
#logging
#исключение
#try_except
#итератор
#генератор
#строка
#кортеж
#множество
#словарь
#список
#полиморфизм
#инкапсуляция
#метод
#ооп
#декоратор
#lambda
#рекурсия
#функция
#match_case
#тернарный
#break_continue
#Циклы
#Условия
аватар форума · 2025-12-24 10:31:15 · python, вопрос, помощь, ошибка, новичок
Python self-motion code
Why doesn't the shape move left in this code? How to loop the movement?   import pygame pygame.init() WIDTH = 500 HEIGHT = 500 FPS = 60 screen = pygame.display.set_mode((WIDT...
аватар форума · 2025-10-10 11:51:30 · python, вопрос, помощь, python3, ии, оптимизация, pip, проект
MTS Tech Arena
One person short for the team. Need someone who understands algorithms and Python syntax.Drop your Discord
аватар форума alex_dev11 · 2026-05-09 07:03:34 ·
Iterating over std::vector: unsigned vs signed index — which to choose?
Hello everyone! I recently started learning C++ and encountered a problem when iterating over `std::vector`. When I write a loop, I usually use `int i`, but the compiler (GCC) give...
аватар форума js_student13 · 2026-05-09 07:03:28 ·
Error in Rust: "expected a literal" when using println! — how to fix?
Hi! I just started learning Rust and encountered an error I can't understand. I'm trying to print a variable value using println!, but the compiler complains. Here's my code: ```...
аватар форума byte_coder98 · 2026-05-09 06:54:16 ·
ESLint error: Cannot read file '.../tsconfig.json' — how to fix?
Hi! I'm new to TypeScript and trying to set up linting in my project. I installed ESLint, typescript-eslint, and created a `.eslintrc.json` config. But when I run ESLint, I get the...
аватар форума python_newbie98 · 2026-05-09 06:51:33 ·
Error TS2322: "could be instantiated with a different subtype of constraint 'object'" — how to fix?
Hi! I'm new to TypeScript and encountered a strange error when using generics. I have a simple function that should take an object and return its keys. I want the function to work...
аватар форума python_newbie22 · 2026-05-09 06:41:12 ·
Kotlin: withContext() vs async-await — what's the difference and which to choose?
Hello, colleagues! I recently started learning coroutines in Kotlin, and I got confused between `withContext()` and the `async-await` construct. At first glance, both allow executi...
аватар форума python_newbie86 · 2026-05-09 06:38:25 ·
Angular @ViewChild Error: Expected 2 arguments, but got 1 — how to fix?
Hi! I'm migrating from Angular 7 to Angular 9 and encountered a confusing error. Previously I used `@ViewChild()` like this: ```typescript @ViewChild('myDiv') myDiv: ElementRef; `...
аватар форума byte_coder75 · 2026-05-09 06:38:22 ·
Multiple values in one case of a switch statement in C# — how to do it correctly?
Hello everyone. I've just started learning C# and encountered a problem when using the switch statement. I need the same block of code to execute for several different values of a ...
аватар форума byte_coder64 · 2026-05-09 06:35:51 ·
In C++ when declaring templates: class or typename — what's the difference and which is better to use?
Hello everyone! I started learning templates in C++ and noticed that in some examples the keyword `class` is used, while in others `typename` is used. For example, these two declar...
аватар форума python_newbie15 · 2026-05-09 06:35:40 ·
In C#: Volatile, Interlocked or lock — what to choose for thread safety of a simple flag?
Hello, colleagues! I'm a beginner C# developer trying to understand multithreading. I have a simple class that starts a background thread. The thread should run while the `_isRunni...
аватар форума program_me32 · 2026-05-09 06:34:06 ·
TS2532 Error: Object is possibly 'undefined' in TypeScript — how to fix?
Hello everyone! I'm new to TypeScript and working on a project with Firebase Cloud Functions and Firestore. I have a function that retrieves data from a Firestore document and proc...
аватар форума code_learner70 · 2026-05-09 06:33:24 ·
Access Modifiers in C#: public, private, protected, internal — what is the difference and when to use what?
Hello everyone! I just started learning C# and writing my first classes. I stumbled upon access modifiers. I kind of understand that `public` is "for everyone", `private` is "only ...
аватар форума js_student20 · 2026-05-09 06:30:51 ·
How to correctly use the PI constant (π) in C++?
Hi! I just started learning C++ and am trying to write a program to calculate the area of a circle. I need to use the number π (pi), but I don't understand how to properly declare ...
аватар форума python_newbie10 · 2026-05-09 06:29:25 ·
In C# for string initialization: string.Empty, String.Empty or "" — which is better?
Hello everyone! I just started learning C# and encountered a question that really confuses me. When I need to declare an empty string, I see three options in different code example...
аватар форума code_learner47 · 2026-05-09 06:28:25 ·
Order of elements in a C# class: fields, properties, constructors, methods — is there a standard?
Hi everyone! I'm a beginner C# developer, and I'm troubled by one question. When I write classes, I just add fields, then properties, then constructors and methods in the order the...
аватар форума program_me32 · 2026-05-09 06:27:35 ·
java.lang.OutOfMemoryError: GC overhead limit exceeded — what to do?
Hello everyone! I am a beginner Java developer writing a small application for log processing. The program reads a large text file (about 500 MB), splits lines into words, and coll...
аватар форума stack_user48 · 2026-05-09 06:26:42 ·
Kotlin: Unresolved reference error in IntelliJ IDEA — what to do?
Hello everyone! I just started learning Kotlin and ran into a problem. I'm writing simple code in IntelliJ IDEA Community Edition, but the IDE gives the error "Unresolved reference...
аватар форума python_newbie90 · 2026-05-09 06:24:27 ·
TypeScript Error: No index signature with a parameter of type 'string' — how to fix?
Hi! I'm new to TypeScript and encountered a problem I can't solve. I have a simple object with string keys, but when I try to access it via a variable, TypeScript throws an error: ...
аватар форума program_me49 · 2026-05-09 06:23:52 ·
PKIX path building failed error during HTTPS connection in Java — how to fix?
Hello everyone! I'm writing a small Java application that should send a GET request to an external REST API over HTTPS. I'm using the standard HttpURLConnection. The code is simple...
аватар форума program_me54 · 2026-05-09 06:20:34 ·
C#: break vs continue — what is the difference in loops?
Hello everyone. I just started learning C#, and I'm confused about the break and continue statements inside loops (for, while, foreach). I understand that both somehow affect loop ...
аватар форума dev_junior20 · 2026-05-09 06:20:23 ·
Kotlin Android: unresolved reference databinding — how to fix the error?
Hi! I'm a beginner Android developer in Kotlin. I'm trying to enable Data Binding in my project, but I get the error: "unresolved reference databinding". Here's what I'm doing: 1...
аватар форума stack_user48 · 2026-05-09 06:19:32 ·
Jackson: Unrecognized field, not marked as ignorable — how to fix the error?
Hi everyone! I'm new to Java and trying to parse JSON into an object using the Jackson library. I have a POJO class `User` with fields `name` and `email`, but the JSON coming from ...
аватар форума learn_code50 · 2026-05-09 06:19:21 ·
String splitting in C++ by delimiter — how to do split?
Hello everyone! I've just started learning C++ and encountered a task that in other languages is solved with a single function. I need to split a string into parts by a delimiter (...
аватар форума code_learner87 · 2026-05-09 06:18:03 ·
Angular: Error "No provider for NameService" — what to do?
Hello everyone! I'm new to Angular (version 2+), trying to understand services and dependency injection. I have a simple service `NameService` that I want to use in a component to ...
аватар форума alex_dev38 · 2026-05-09 06:16:42 ·
Error «This application is modifying the autolayout engine from a background thread» — how to fix?
Hello everyone! I'm a beginner in Swift and macOS development. I encountered a strange error that doesn't always appear, but only when the application performs some long operation....
аватар форума dev_junior36 · 2026-05-09 06:16:16 ·
Checking Internet Connectivity in Swift — A Simple and Reliable Solution
Hello everyone! I'm a beginner in Swift and iOS development. I'm writing an app that loads data from the network, but I've run into a problem: if the internet is disconnected, the ...
аватар форума dev_junior22 · 2026-05-09 06:15:01 ·
Angular 2 @ViewChild returns undefined — how to properly access a child component?
Hello everyone! I'm new to Angular (2+) and TypeScript, and I've run into a problem that has me stumped. I'm trying to access a child component via the @ViewChild decorator, but it...
аватар форума alex_dev53 · 2026-05-09 06:14:27 ·
Error "parserOptions.project has been set for @typescript-eslint/parser" — how to fix?
Hi! I'm new to TypeScript and trying to set up ESLint in my project. I'm using @typescript-eslint/parser and @typescript-eslint/eslint-plugin. But when running ESLint, I get a stra...
аватар форума python_newbie36 · 2026-05-09 06:14:20 ·
Kotlin: Interface does not have constructors — how to create an instance?
Hi! I recently switched from Java to Kotlin and encountered a strange error. I have an interface `Drawable`: ```kotlin interface Drawable { fun draw() } ``` I want to create ...
аватар форума js_student83 · 2026-05-09 06:13:20 ·
C++ File Extensions: .cc, .cpp, .cxx, .h — What's the Difference and Which to Choose?
Hello everyone! I just started learning C++ and am writing simple programs in Visual Studio Code. I noticed that when I create a new file, I'm offered a bunch of extensions: .cpp, ...
аватар форума code_learner38 · 2026-05-09 06:12:32 ·
toString() in Java: String concatenation or StringBuilder — which is faster and better?
Hello everyone! I'm a beginner Java developer, and I have a question about implementing the `toString()` method in my classes. Let's say I have a simple class with several fields:...
аватар форума learn_code75 · 2026-05-09 06:11:21 ·
Kotlin: Void, Unit and Nothing — what's the difference and when to use what?
Hello everyone! I recently started learning Kotlin and switched from Java. In Java, I'm used to void for methods that return nothing. But in Kotlin, I see three similar concepts: V...
аватар форума alex_dev87 · 2026-05-09 06:06:41 ·
How to properly import local packages in Go (Golang) — step-by-step guide
Hello everyone! I recently started learning Go and ran into a problem that completely baffles me. I'm trying to organize code in multiple files within one project, but importing lo...
аватар форума program_me32 · 2026-05-09 06:04:37 ·
PHP Error: Expected T_PAAMAYIM_NEKUDOTAYIM — What Does It Mean?
Hi everyone! I'm a beginner in PHP and trying to understand classes. I'm writing a simple script, but I get an error: "Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDO...
аватар форума python_newbie94 · 2026-05-09 06:03:49 ·
Function declared in another file is not visible — "undefined" error in Go
Hi everyone! I just started learning Go and encountered a very strange problem. I have two files in the same `main` folder: **main.go:** ```go package main func main() { hell...
аватар форума byte_coder31 · 2026-05-09 06:03:16 ·
Serialization of PHP arrays: json_encode vs serialize — which to choose?
Hello everyone! I'm a beginner in PHP and faced a dilemma while developing a project. I need to save arrays to cache (files or Redis) and then read them back. I found two methods: ...
аватар форума learn_code14 · 2026-05-09 06:01:27 ·
TypeScript: error TS7006 — parameter implicitly has an 'any' type, how to fix?
Hello everyone! I recently started learning TypeScript and encountered an error I can't understand. I have a simple code for processing an array of users. I'm trying to filter acti...
аватар форума stack_user23 · 2026-05-09 05:56:58 ·
PHP: define() vs const — what's the difference and which is better to use?
Hello everyone! I've been writing PHP for about a year, and one question constantly bothers me. I see that in different projects constants are declared differently: some use define...
аватар форума code_learner27 · 2026-05-09 05:55:04 ·
SQL injection that bypasses mysql_real_escape_string() — how to protect yourself?
Hello everyone! I'm a beginner PHP developer and I've encountered a very strange situation. Many forums say that the `mysql_real_escape_string()` function is a reliable protection ...

Interesting