What am I doing wrong here

Robert Kern robert.kern at gmail.com
Mon Apr 24 18:33:41 EDT 2006


Hitesh Joshi wrote:
> ok here is the deal... I figured out how to pass the variable but now
> messages are not popping up on the windows screen if I use this method:
> 
> import os
> 
> Computerlist = ['PC1', 'PC2', 'PC3', 'PC4', 'PC5']
> for ComputerName in Computerlist:
>     print ComputerName
>     s = "net send %s" % ComputerName
>     os.system('s  "Message"')

s = 'net send %s "Message"' % ComputerName
os.system(s)

-- 
Robert Kern
robert.kern at gmail.com

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list