U
U
UtkaDuck1232020-06-23 09:36:58
Python
UtkaDuck123, 2020-06-23 09:36:58

Is it possible to pass the value of a variable to the shutdown -t attribute using the os module?

def shutdown():
    hour=int(shutdownEntry_h.get())
    min=int(shutdownEntry_m.get())
    sec=int(shutdownEntry_s.get())
    if min!=""and hour!=""and sec!="":
        in_min_h=hour*60
        in_min_m=min*1
        in_min_s=sec/60
        min_sum=in_min_h+in_min_m+in_min_s
        print(min_sum)
        os.system("shutdown -s -t min_sum")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
ScriptKiddo, 2020-06-23
@UtkaDuck123

os.system(f"shutdown -s -t {min_sum}")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question