Is there any better way to approach this problem?

2006-07-19 Thread Hitesh Joshi
Hi,

I am newbie python dude. I need few hints.

 I created a DB table with following fields
UserID(PK), TimeStamp, Version, IP, Port

I need to insert these info from this .log file and the log file has
lines like following with some junk garbase like "attempt using client
software " I need to get rid of that.

10:03:54.527 (01) - User (xxx123) login attempt using client software
version (1.0.1.1) from IP (xxx.xxx.xxx.xxx) port ()

Create a while 1 loop, read line from file.. disect line and insert
'stuff' into those variables and then run a query from inside the
python to insert data... and do this untill EOF...
Is there any better way to approach this problem?

so if I have variable , let's say, TimeStamp, UserID, Version,
IPAddress and  PortNum.. how can I disect this line and insert into
this variable? 

Thank you,
hj

-- 
http://mail.python.org/mailman/listinfo/python-list


What am I doing wrong here

2006-04-24 Thread Hitesh Joshi
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"')

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What am I doing wrong here

2006-04-24 Thread Hitesh Joshi
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"')

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What am I doing wrong here

2006-04-24 Thread Hitesh Joshi
Thank you Robert, It worked!!!

Thank you so much

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What am I doing wrong here

2006-04-24 Thread Hitesh Joshi
Thank you all for the quick replies. It worked! Truely appriciated. I
am python novice and still learning I hope to contribute to this
group someday :)

Hitesh

-- 
http://mail.python.org/mailman/listinfo/python-list