Python Forum
Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 19,437
» Latest member: AlexZolotov
» Forum threads: 38,550
» Forum posts: 174,695

Full Statistics

Online Users
There are currently 422 online users.
» 0 Member(s) | 418 Guest(s)
Bing, Google, Yandex, Baidu

Latest Threads
How to understand object-...
Forum: General Coding Help
Last Post: snl_9527
6 hours ago
» Replies: 2
» Views: 152
Picamera2 commands betwee...
Forum: General Coding Help
Last Post: deanhystad
Yesterday, 07:39 PM
» Replies: 1
» Views: 172
Python script not working...
Forum: Web Scraping & Web Development
Last Post: texwilson47
Yesterday, 05:57 PM
» Replies: 2
» Views: 147
PyVisa Query Command fail...
Forum: General Coding Help
Last Post: deanhystad
Yesterday, 04:58 PM
» Replies: 1
» Views: 169
[SOLVED] [Beautiful Soup]...
Forum: General Coding Help
Last Post: Winfried
Yesterday, 03:46 PM
» Replies: 2
» Views: 160
[SOLVED] [Beautiful Soup]...
Forum: General Coding Help
Last Post: Winfried
Yesterday, 03:43 PM
» Replies: 2
» Views: 273
CSV reader with PyQt6
Forum: Code sharing
Last Post: Axel_Erfurt
Yesterday, 11:38 AM
» Replies: 3
» Views: 190
where should DEFAULT_CIPH...
Forum: General Coding Help
Last Post: snippsat
Yesterday, 07:00 AM
» Replies: 8
» Views: 401
what name to give to a ne...
Forum: News and Discussions
Last Post: Skaperen
Apr-30-2025, 09:39 PM
» Replies: 4
» Views: 203
function arguments
Forum: General Coding Help
Last Post: Curbie
Apr-30-2025, 05:23 PM
» Replies: 2
» Views: 236

 
  end boss aiming at player
Posted by: flash77 - May-25-2024, 06:06 PM - Forum: Game Development - Replies (7)

Hi,

I managed in my game that the end boss is aiming at the actual player's position with his gun.

I have a question about my class "EndBossGun(..... More


Attached Files

Thumbnail(s)
   
Print this item

  I am getting this TypeError: 'TreasureMap' object is not subscriptable.
Posted by: makilakos - May-25-2024, 09:36 AM - Forum: General Coding Help - Replies (2)

Thank you in advance
I am getting this TypeError: 'TreasureMap' object is not subscriptable.

This is my code
[python]i = 0
k = 0

class Treas..... More

Print this item

  is this really a syntax error?
Posted by: Skaperen - May-24-2024, 10:46 PM - Forum: General Coding Help - Replies (4)

if i run this from a file it works as expected. if i type the same code into interactive python, i get a syntax error. which is the mistake? is thi..... More

Print this item

  reading pdfs
Posted by: DPaul - May-24-2024, 05:21 PM - Forum: Bar - Replies (2)

I often get handed pdfs generated with an app like excel, or word.
If there are gridlines , separating rows and columns, these pdfs can be "OCR"red..... More

Print this item

  web scraping IMDb database
Posted by: guidoguidi - May-24-2024, 04:42 PM - Forum: Data Science - Replies (2)

I am trying to extract information from an IMDb webpage. In particular the names and the description of the 50 actors.
This is my code and the error t..... More

Print this item

  How to capture the result set from a stored procedure?
Posted by: dee - May-24-2024, 04:07 PM - Forum: General Coding Help - Replies (5)

Hello,
When I ran the following code, it got the message "No results. Previous SQL was not a query." How do I get the dataset returned from the stor..... More

Print this item

  how can I organise my code : best practice?
Posted by: pythonbum - May-24-2024, 03:17 PM - Forum: General Coding Help - No Replies

Hello
I have a long script I want to simplfy
Right now, i have main.py file which call lots of functions.
all my functions are defined in a [b]helper...... More

Print this item

  speed up getting embedding from bert model for large set of text
Posted by: veda - May-24-2024, 10:05 AM - Forum: General Coding Help - Replies (7)

Hi python experts,

I tried to get embedding from pre-trained language model with the function listed below. However, it took forever to execute if ..... More

Print this item

  what to return for an empty list
Posted by: Skaperen - May-24-2024, 03:37 AM - Forum: General Coding Help - Replies (2)

i have a function to test if multiple items all meet a certain condition. another function is to test if multiple items all fail to mee..... More

Print this item

  Unbalance Dataset - prediction model
Posted by: AlainProvist - May-24-2024, 12:06 AM - Forum: Data Science - No Replies

Hey everyone.

I am working on personal project that can change the face of the restaurant industry.

Let’s make it simple. Dataset of 63k rows, 7..... More


Attached Files

Thumbnail(s)
   
Print this item

  Look over this code
Posted by: dknobby7 - May-23-2024, 11:27 PM - Forum: General Coding Help - Replies (1)

Hey guys would anyone be able to look over this for a buddy of mine and see why this is not working. I’m not familiar with really any python.

From ..... More

Print this item

Question SOLVED: Using TTP to extract an unknow number of words from a line
Posted by: Calab - May-23-2024, 05:24 PM - Forum: Data Science - Replies (5)

I'm using Python v 3.10.11 and ttp v 0.9.5. I am trying to build a TTP template that can extract an unknown number of words from a line into a group...... More

Print this item

  remove duplicates from dicts with list values
Posted by: wardancer84 - May-23-2024, 02:46 PM - Forum: General Coding Help - Replies (27)

Hi,

i need to remove duplicates from dicts with list values, this weird structure comes from defaultdict btw...

example:

[python]

dict1 = ..... More

Print this item

  Help with cursor in terminal
Posted by: river251 - May-23-2024, 07:09 AM - Forum: General Coding Help - Replies (2)

I haven't been able to find a forum where this clearly belongs so I hope I will be redirected if this is a wrong place.

I'm trying to learn python...... More

Print this item

Information Is it possible to multi line a Basic Function Construct line statement? If so how?
Posted by: BrandonKastning - May-23-2024, 12:52 AM - Forum: General Coding Help - Replies (7)

Hey everyone!

Just learned how to properly pass variables while dropping globals as my Primary method of utilizing them.

My Monitor(s) are ancie..... More

Print this item

  matplotlib chart text font misery with 5x8 dot matrix
Posted by: Knabbler - May-22-2024, 11:57 PM - Forum: Data Science - Replies (6)

I can't get matplotlib to create my plots the way it needs to. This problem of font representation doesn't exist in Pillow.
After 40 hours of searchi..... More


Attached Files

.bmp   example-result.bmp (Size: 46.94 KB / Downloads: 2)
.bmp   regular-canvas.bmp (Size: 46.94 KB / Downloads: 2)
Print this item

  Invalid Date Format fo Cached Files
Posted by: jland47 - May-22-2024, 05:21 PM - Forum: General Coding Help - Replies (1)

In this python code I am attempting to extract files from a FTP folder and then search through them for an invoice#. I have the command window open w..... More


Attached Files

Thumbnail(s)
   
Print this item

  Do you know any cool services for learning?
Posted by: Cook3Aaron - May-22-2024, 06:16 AM - Forum: Bar - Replies (3)

Do you know any cool services for learning? It would be really cool to simplify my learning

Print this item

  Print the next 3 lines
Posted by: knob - May-22-2024, 05:01 AM - Forum: General Coding Help - Replies (3)

Once i enter in this loop, how could i print not only the current line, but the next 3 lines after the current line ?

[code]for line in work01:
..... More

Print this item

  maxsplit question
Posted by: tester_V - May-22-2024, 01:40 AM - Forum: General Coding Help - Replies (2)

Greetings!
I'm confused about the maxsplit.
Here is an example.
[python]
s = 'BKM0001-01-XLPM034NMS'
print(f"*** {s} ***")
dd = s.split('-',2)[..... More

Print this item

  argparser not showing all options
Posted by: bigal - May-22-2024, 12:58 AM - Forum: General Coding Help - Replies (1)

I have a python project with several command line (argparser) options which have been working. I went to modify the --scan arg to accept a integer and..... More

Print this item

  Adding image to program on programiz.com
Posted by: ebn852_pan - May-21-2024, 08:30 PM - Forum: Homework - Replies (1)

[code]
class Person:
name = " "
stat = " "

person1 = Person()
person1.name = "Ross Kagawa"

def battingaverage():
z = float(..... More

Print this item

  I can't for the life of me get this basic If statement code to work
Posted by: CandleType1a - May-21-2024, 01:28 PM - Forum: General Coding Help - Replies (8)

Hiya,

I just started learning Python yesterday, and in one of the videos I was watching, the person showed a very basic piece of code involving two..... More


Attached Files

Thumbnail(s)
   
Print this item

  Working with group of lines
Posted by: knob - May-21-2024, 03:29 AM - Forum: General Coding Help - Replies (1)

I have a file with hundred of lines. They are grouped similar to the example below.

What would be the best approach to move or copy the line that ..... More

Print this item

  How to run this triple integration in python
Posted by: Safinazsalem - May-20-2024, 09:43 AM - Forum: Homework - Replies (1)

When I run the following triple integral in python, it gives me an error:

[python] IntegrationWarning: The occurrence of roundoff error is detected..... More

Print this item

  Need to fix ValueError: Asking to pad but the tokenizer does not have a padding token
Posted by: alexanderDennisEnviro500 - May-20-2024, 08:07 AM - Forum: Data Science - No Replies

I want to fine tune a QnA HF model with the JSON file containing questions and answers, but I get aforementioned error.

Full code:
[python]
# htt..... More

Print this item

  AWS Boto3 - objects function
Posted by: PythonDialer - May-19-2024, 11:50 AM - Forum: General Coding Help - No Replies

Hi ,

I am using this code to display each key or file of AWS S3 bucket.

It is doing the job that I want. However, When I look at AWS Boto3 pack..... More

Print this item

  Can you explain the strings in Python
Posted by: ebn852_pan - May-19-2024, 02:02 AM - Forum: General Coding Help - Replies (3)

x = 2
x = str(x)
print("Years on the force is "  + x)
Years on the force is 2 #Casting. 2 is not string but a int. Python sees thi..... More

Print this item

  My first python game : Tic-Tac-Toe
Posted by: ForsakenDusk - May-19-2024, 01:39 AM - Forum: Game Development - Replies (7)

Hello everyone,

Here is my first python game : Tic-Tac-Toe.

I would like hints about code optimization.

[python]
#grid creation
grid = []
..... More

Print this item

  How returns behave in a function with multiple returns?
Posted by: khasbay - May-19-2024, 12:01 AM - Forum: General Coding Help - Replies (1)

The code below returns 8. Why does not it return 2 instead? I do not understand how return behaves in the code below. what is the rule? Thanks for ..... More

Print this item

  [split] collections.Counter()
Posted by: ebn852_pan - May-18-2024, 09:23 PM - Forum: Bar - Replies (2)

I get the idea. First I'd like to know how I can use or download JetBrains IDE? It keeps redirecting me to another online youtrack.jetbrains.com/sit..... More

Print this item

  compare parts of a 2-tuple differently
Posted by: Skaperen - May-18-2024, 08:52 PM - Forum: General Coding Help - No Replies

i have a function that returns a 2-tuple. i have a previous value from that same function i want to compare it with. the previous value is an item f..... More

Print this item

  os.listdir() and follow_symlinks
Posted by: Skaperen - May-18-2024, 05:44 PM - Forum: General Coding Help - Replies (6)

many functions call with a file system path can also choose whether to follow symlinks (usually the default) or not. is there a way to make this choi..... More

Print this item

  problem program runs in a loop
Posted by: jasserin - May-18-2024, 03:07 PM - Forum: General Coding Help - No Replies

I'm a beginner in python. I use a mediapipe lib.

I'm using this program and I get an error that I don't understand, concerning Tensorflow.

here..... More


Attached Files

.json   chemin_source.json (Size: 132 bytes / Downloads: 111)
.json   chemin_traite.json (Size: 131 bytes / Downloads: 124)
.py   test image mesh_contour_losange.py (Size: 7.43 KB / Downloads: 138)
Print this item

  Creating a deselect button
Posted by: dwayne091 - May-18-2024, 07:48 AM - Forum: General Coding Help - Replies (2)

Am trying to create a deselect button to deselect the checkbuttons all at once any ideas on how to do
It?


My code


[python]
from tkinter ..... More

Print this item

Forum stats
Latest posts
Topic Date, time  Author Last Sender Forum
  How to understand object-... 6 hours ago snl_9527 snl_9527 General Codin...
  Picamera2 commands betwee... Yesterday, 19:39 GigiG deanhystad General Codin...
  Python script not working... Yesterday, 17:57 texwilson47 texwilson47 Web Scraping ...
  PyVisa Query Command fail... Yesterday, 16:58 dazz deanhystad General Codin...
  [SOLVED] [Beautiful Soup]... Yesterday, 15:46 Winfried Winfried General Codin...
  [SOLVED] [Beautiful Soup]... Yesterday, 15:43 Winfried Winfried General Codin...
  CSV reader with PyQt6 Yesterday, 11:38 suburbanprojects Axel_Erfurt Code sharing
  where should DEFAULT_CIPH... Yesterday, 07:00 Skaperen snippsat General Codin...
  what name to give to a ne... 04-30, 21:39 Skaperen Skaperen News and Disc...
  function arguments 04-30, 17:23 Curbie Curbie General Codin...
  Eight Queens Problem, err... 04-30, 16:22 snl_9527 Gribouillis General Codin...
Most views
  The best Prog... 557457
  Tutorial Requ... 424472
  Web Scraping ... 422937
  Newbie with P... 351003
  Thread remain... 324897
Most reputation
buran 580
snippsat 506
Larz60+ 452
Gribouillis 362
deanhystad 325
Most replies
  New Users Int... 449
  [book] Variou... 188
  CKEditor / Ri... 100
  moving from t... 95
  Free keys and... 91
Top posters
Larz60+ 12036
buran 8165
snippsat 7324
deanhystad 6809
metulburr 5151
Top referrers
Googlepro 22
metulburr 6
python 6
NonEntity 5
buran 3
Newest members
AlexZolotov Yesterday
ekaintan1590 Yesterday
juanadaniel096 Yesterday
dar Yesterday
preethi Yesterday

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020