« first day (2242 days earlier)      last day (1114 days later) » 

1:20 PM
I'm new to creatting classes. Can anyone help me create a blank instance of a class which can then be populated? This is what I've tried so far but it says that the feilds are required:

def DefineVoids(PenVoids, Landlords):

class Void:
def __init__(self, HasGas, Agent, SalesRef, LandlordName, MeterSetup, WantEmail, LEmail, LHouse, LAddress, LTown, LRegion, LPostcode, LRequest):
self.HasGas = HasGas
self.Agent = Agent
self.SalesRef = SalesRef
self.LandlordName = LandlordName
self.MeterSetup = MeterSetup
 
1 message moved from Python
 
 
7 hours later…
8:02 PM
from PIL import Image
import numpy as np

rng = np.random.default_rng()

img_pil = Image.open("test_image.png")
img = np.array(img_pil)
img = (img * rng.uniform(size=img.shape[:-1]).astype(img.dtype)
# put it back into PIL which I didn't google
missing ) before .astype
2 messages moved from Python
 

« first day (2242 days earlier)      last day (1114 days later) »