Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Problems converting bytes from socket.recvfrom
Post: Problems converting bytes from socket.recvfrom

I'm trying to convert bytes from the recvfrom function to text but i get this error: Error:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xac in position 4: invalid start bytewith different byte...
riccardoob Networking 1 2,034 Jun-24-2021, 03:50 PM
    Thread: Detect http request on my ip
Post: Detect http request on my ip

I want to write a python script that detects when a http request is made on the IP address of my home network. I have a dynamic DNS set up so that I can access my little home server any time. I want t...
riccardoob Networking 1 2,223 Jun-07-2021, 12:33 PM
    Thread: Importing issues with base class for inheritance
Post: RE: Importing issues with base class for inheritan...

(May-19-2021, 04:26 PM)Gribouillis Wrote: To understand how it works you need to have some basic notions of how import statements work. When it executes say import food_bot.price, Python looks in th...
riccardoob General Coding Help 5 4,720 May-19-2021, 04:46 PM
    Thread: Importing issues with base class for inheritance
Post: RE: Importing issues with base class for inheritan...

(May-19-2021, 02:55 PM)Gribouillis Wrote: You could import pricing prior to item_pricing in init.py # pricing/__init__.py from .pricing import Pricing from .item_pricing import ItemPricingthen in th...
riccardoob General Coding Help 5 4,720 May-19-2021, 03:05 PM
    Thread: Importing issues with base class for inheritance
Post: Importing issues with base class for inheritance

Hi, I'm trying to make a class that inherits from another one. The problem I'm having is related to imports, I'll try to explain as best as I can. food_bot ├── __init__.py ├── price │   ├── __init__....
riccardoob General Coding Help 5 4,720 May-19-2021, 12:44 PM
    Thread: Grouping algorithm
Post: RE: Grouping algorithm

(May-19-2020, 01:11 PM)deanhystad Wrote: Add diagonal checks inside the for loop. You would add a check_adjacent(coord, 1, 1) for example. Perfect, thank you very much for your answers
riccardoob General Coding Help 7 3,039 May-19-2020, 01:13 PM
    Thread: Grouping algorithm
Post: RE: Grouping algorithm

(May-19-2020, 12:07 PM)deanhystad Wrote: matrix = [ [0, 0, 0, 0, 1], [0, 0, 0, 1, 1], [0, 0, 1, 0, 1], [0, 0, 0, 0, 0], ] def get_cells(matrix, r, c): """Return list of continuous matches of ma...
riccardoob General Coding Help 7 3,039 May-19-2020, 12:51 PM
    Thread: Grouping algorithm
Post: RE: Grouping algorithm

(May-19-2020, 10:28 AM)DeaD_EyE Wrote: You can solve it with numpy: import numpy as np matrix = [ [0, 0, 0, 0, 1], [0, 0, 0, 1, 1], [0, 0, 1, 0, 1], [0, 0, 0, 0, 0], ] group = [index for index, v...
riccardoob General Coding Help 7 3,039 May-19-2020, 10:37 AM
    Thread: Grouping algorithm
Post: Grouping algorithm

As the title says I'm trying to write a grouping algorithm, although I'm not sure if that is the right term to describe what I need. Here a better explanation: I have a matrix m rows by n columns, eac...
riccardoob General Coding Help 7 3,039 May-19-2020, 09:58 AM
    Thread: Detecting windows shutdown event
Post: RE: Detecting windows shutdown event

I read the post you linked, but I don't need to interrupt shutdown process, I essentially want to execute a script when the shutdown button is pressed (not the physical one) and make sure that it exec...
riccardoob General Coding Help 4 5,736 Nov-12-2019, 04:10 PM
    Thread: Detecting windows shutdown event
Post: Detecting windows shutdown event

Hi, I probably have a tricky question here. I'd like to know if there's a way in python to detect (maybe using an infinite loop in a script run in background) if windows is shutting down, does anyone ...
riccardoob General Coding Help 4 5,736 Nov-12-2019, 09:49 AM
    Thread: Function assigned at a button in tkinter
Post: RE: Function assigned at a button in tkinter

So I tried to create a separate class to hold all the front-end presentation but the problem is still the same: when I tie the function player_folds to the buttons I have to pass them a different inde...
riccardoob General Coding Help 9 4,187 Oct-06-2019, 11:14 AM
    Thread: Function assigned at a button in tkinter
Post: RE: Function assigned at a button in tkinter

Thanks for the answer, I kinda understood what I have to do. As soon as I find some time to test the solution and make it work I'll flag the discussion as solved.
riccardoob General Coding Help 9 4,187 Oct-05-2019, 07:44 PM
    Thread: Function assigned at a button in tkinter
Post: RE: Function assigned at a button in tkinter

Thanks for the side note. self.hands_inputs is the argument of player.fold() because fold is the function that's supposed to delete from the tkinter window (usinf the command widget.grid_forget()) som...
riccardoob General Coding Help 9 4,187 Oct-05-2019, 07:04 PM
    Thread: Function assigned at a button in tkinter
Post: RE: Function assigned at a button in tkinter

The list self.hands_inputs holds the buttons and pplayers is another list but that one holds player object, the player class has a method called fold, I'm trying to assign to self.hands_inputs[2][0] ...
riccardoob General Coding Help 9 4,187 Oct-05-2019, 05:50 PM
    Thread: Function assigned at a button in tkinter
Post: RE: Function assigned at a button in tkinter

Thanks for answering, by string id of the command I mean this output print(self.hands_inputs[2][0:pnumplayer]), and as I said in the post the ids are all different but the all link to the same positi...
riccardoob General Coding Help 9 4,187 Oct-05-2019, 05:28 PM
    Thread: Function assigned at a button in tkinter
Post: Function assigned at a button in tkinter

for y in range(0, pnumplayers):#third list of hands_inputs filled with fold button self.hands_inputs[2].append(Button(self.window, text='Fold', command = lambda: pplayers[y].fold(self.hands_inputs...
riccardoob General Coding Help 9 4,187 Oct-05-2019, 02:45 PM
    Thread: I can't install bigfloat using pip
Post: RE: I can't install bigfloat using pip

I tried to reinstall the build tools the log told me to, now i get a different error, at least I think it's different, it's so much text. Can anyone understand something out of this? C:\Users\ricca>...
riccardoob General Coding Help 6 5,600 Sep-03-2019, 05:40 PM
    Thread: I can't install bigfloat using pip
Post: RE: I can't install bigfloat using pip

Even downloading different version of the Microsoft Visual C++ I receive the same errore, can please someone point me out a direct link to the download I need? Thanks
riccardoob General Coding Help 6 5,600 Sep-02-2019, 07:02 AM
    Thread: I can't install bigfloat using pip
Post: RE: I can't install bigfloat using pip

Ops... I noticed only now that it's required Microsoft Visual C++ 14.0, anyway I tried and installed it and retried the procedure to install bigfloat but i got the same error.
riccardoob General Coding Help 6 5,600 Sep-01-2019, 08:00 PM

User Panel Messages

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