jeudi 3 février 2022

Change the value of an order

I'm trying to change the value of a command on each run. For this I tried a prototype like this:

import os
import random
from random import random

class testShutDown :

    ticks = random.randint(10,100)
    os.system("shutdown /s /t {ticks}")

According to me, with each execution of the code, the computer must shut down randomly between 10 and 100 seconds.

Unfortunately, it doesn't work... I hope someone can help me solve this problem which seems simple to me, but not for me.




Aucun commentaire:

Enregistrer un commentaire