user26997: I'm using this library and I couldn't find how to modify that value (skill).
In any case, what I want is to be able to vary the level of difficulty of stockfish using python chess.

user26806: The simplest way I can think of is through a dilution method. You either get a weaker chess AI that you have created yourself or someone else has created and use that bot to dilute the stockfish bot.
for example a 35% stockfish 12 (~3500 elo) and 65% my custom chess ai (~1500 elo) would theoretically be 0.35 * 3500 + 0.65 * 1500 elo or 2200. This is just an estimate of level as chess elo progression isn't linear (i.e the difference between a 1000 and 1200 isn't the same as a 2000 and 2200)
The way the dilution occurs is by randomly picking which bot will make which moves. So 35% of moves will be made by stockfish 12 and 65% will be made by my bot.
if you want to increase or decrease the difficulty just adjust the the concentration of the two bots.

user825: Send an UCI command Skill Level. Something like setoption name Skill Level value 10.
EDIT:
https://python-chess.readthedocs.io/en/v0.25.0/uci.html. Please look at setoption.

user26997: Thanks.
With this syntax you can set the skill level:
engine.configure({"Skill Level": 7})

https://python-chess.readthedocs.io/en/latest/engine.html#options

26997: <p>I'm using this library and I couldn't find how to modify that value (skill).
In any case, what I want is to be able to vary the level of difficulty of stockfish using python chess.</p>
 26806: <p>The simplest way I can think of is through a dilution method. You either get a weaker chess AI that you have created yourself or someone else has created and use that bot to dilute the stockfish bot.</p>
<p>for example a 35% stockfish 12 (~3500 elo) and 65% my custom chess ai (~1500 elo) would theoretically be 0.35 * 3500 + 0.65 * 1500 elo or 2200. This is just an estimate of level as chess elo progression isn't linear (i.e the difference between a 1000 and 1200 isn't the same as a 2000 and 2200)</p>
<p>The way the dilution occurs is by randomly picking which bot will make which moves. So 35% of moves will be made by stockfish 12 and 65% will be made by my bot.</p>
<p>if you want to increase or decrease the difficulty just adjust the the concentration of the two bots.</p>
 825: <p>Send an UCI command <code>Skill Level</code>. Something like <code>setoption name Skill Level value 10</code>.</p>
<p>EDIT:</p>
<p><a href="https://python-chess.readthedocs.io/en/v0.25.0/uci.html" rel="nofollow noreferrer">https://python-chess.readthedocs.io/en/v0.25.0/uci.html</a>. Please look at <code>setoption</code>.</p>
 26997: <p>Thanks.
With this syntax you can set the skill level:</p>
<pre><code>engine.configure({&quot;Skill Level&quot;: 7})
</code></pre>
<p><a href="https://python-chess.readthedocs.io/en/latest/engine.html#options" rel="nofollow noreferrer">https://python-chess.readthedocs.io/en/latest/engine.html#options</a></p>
