How to add a string to os.system() command? (Python) -
i add tweet = "@idoodler cpu temperature " + str(cpu_temp)
os.system("sudo twidge update \"tweet\"")
(tweet tweet string above). can please tell me how can add tweet string os.system() command?
cmd = "sudo twidge update \"{0}\"".format(tweet) print cmd os.system(cmd)
although honest better off using subprocess.call
import subprocess subprocess.call(["sudo","twidge","update",tweet])
Comments
Post a Comment