Skip to content Skip to sidebar Skip to footer

How To Fix Error In Client/server (reasked)

I want to pick a random element from my list so I use random.sample(output, 1) and then remove it, but first I transfer this element to a client process before deleting it. What I

Solution 1:

You're only showing us part of your code, so we can't do very much. I'm guessing you have from random import random, and that's what's causing your AttributeError. That imports the random function, not the random module. You need import random.

Given that error, none of your server code has ever run. You have encode misspelled as enconde. You are grabbing your sample from output. but you are removing it from records.

As you can imagine, this is not a good way to do a client/server setup. You don't want to repeatedly exchange stuff back and forth.

Post a Comment for "How To Fix Error In Client/server (reasked)"