Reputation: 3545
I like to add tweet = "@idoodler My CPU temperature is " + str(CPU_temp)
to os.system("sudo twidge update \"tweet\"")
(tweet is the tweet string above). Can anyone please tell me how I can add the tweet string to the os.system() command?
Upvotes: 0
Views: 3771
Reputation: 113930
cmd = "sudo twidge update \"{0}\"".format(tweet)
print cmd
os.system(cmd)
although to be honest you are probably better off using subprocess.call
import subprocess
subprocess.call(["sudo","twidge","update",tweet])
Upvotes: 1