What am I doing wrong here

Hitesh Joshi hitesh287 at gmail.com
Mon Apr 24 18:02:14 EDT 2006


Hi,

I wanted to pass a popup mesage using windows messagin service to five
PCs.
If I just use following then PC1 gets the popup service message:

import os
os.system('net send PC1  "Message"')


But if I try to create a for loop like this it doesn't work.... how can
I pass computerName var as an argument?
What am I doing wrong here? Thank you in advance....

import os

Computerlist = ['PC1', 'PC2', 'PC3', 'PC4', 'PC5']
for ComputerName in Computerlist:
    print ComputerName
    os.system('net send ComputerName  "Message"')




More information about the Python-list mailing list