Schnorr signature using discrete logarithm / problem with python implementation
Beware, notice the $s$ is computed modulo $(q-1)$ (due to Fermat's little theorem).
You have to write $s = (k - (x * e)) \mod{ (q-1)}$.