Running a python script from interactive mode

2009-11-17 Thread ashwini yal
Hi,

I am trying to run a python script from interactive mode ,but i am not able
to know how to run it? Is it possible? if yes please let me how to run the
script?

-- 
Regards ,
Ashwini . K
-- 
http://mail.python.org/mailman/listinfo/python-list


multitasking

2009-11-23 Thread ashwini yal
Hi,

I want to know diffrent methods of multitasking supported by python(I want
to run diffrent jobs simultaneously at same time) which is the good
approach.

I know about threads,but i also know that using threads leads to less
operational speed.

Can someone help me

-- 
Regards ,
Ashwini . K
-- 
http://mail.python.org/mailman/listinfo/python-list


Special characters (^M & ^[[D) when I read pxssh::before and write it to a file

2010-03-17 Thread ashwini yal
Hi,

I am writing a python script which logs into the machine using pxssh, sends
a command, reads the response and writes the response to the file.

But, when I open the file in the editor like vi, its showing special
characters like ^M and ^[[D instead of spaces or newlines.

This is how my code looks like ...

s = pxssh.pxssh()
s.login(ip, username, password)

cmd = 'xyz'
s.sendline (cmd)
s.prompt()
output = s.before
fileWrite = open(filePath , 'wb')
fileWrite.write(output)
s.prompt()


This is how my filePath looks like when I open it using vi editor.

Starting command execution on host xxx.xxx.xxx.xxx

D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^[[D^M

Command executed successfully ^M

Executing next command ...^M

-- 
Regards ,
Ashwini . K
-- 
http://mail.python.org/mailman/listinfo/python-list