Re: popen and password entry

2006-06-15 Thread sinan nalkaya
finally following code works, import pexpect, sys cmd = '/usr/bin/rsync config [EMAIL PROTECTED]:/tmp/.' #cmd = 'ssh [EMAIL PROTECTED]' child = pexpect.spawn(cmd) child.logfile = sys.stdout passwd = 'qwe123' i = 0 try: while i == 0: i = child.expect(['Password:','Password:

Re: popen and password entry

2006-06-15 Thread sinan nalkaya
i put while True: before top of line, i=child.expect() . it worked, the file has gone but also it goes into loop with many EOF result, i tried the os.waitpid() function with child.pid but didnt help me. still couldn`t get the problem. thanks for help On Thursday 15 June 2006 12:04, Ganesan Raj

Re: popen and password entry

2006-06-15 Thread sinan nalkaya
thanks for reply, i add the line you suggested, thats what i get [EMAIL PROTECTED]:~/tmp/multi_server$ python deneme.py Password: qwe123 finished Exception pexpect.ExceptionPexpect: in > ignored does rsync may cause a problem while trying to fork-exec ssh ? > Add "child.logfile = sys.stdout" he

Re: popen and password entry

2006-06-14 Thread Sinan Nalkaya
hi,i have found expect method for this purpose. i`m trying to use pexpect but following code gives me an something strange as a result.# The CODEimport pexpectcmd = '/usr/bin/rsync config [EMAIL PROTECTED]:/tmp/.' #cmd = 'ssh [EMAIL PROTECTED]'child = pexpect.spawn(cmd)passwd = 'qwe123'try:   

popen and password entry

2006-06-14 Thread sinan nalkaya
hello, i want to use rsync for remote file transfer via popen, but couldnt pass the Password yet. here`s what i did cmd = 'rsync -av config [EMAIL PROTECTED]:/tmp/.' f = os.popen(cmd,'w') f.write('1234') #not worked f.write('1234\n') #not worked every time i see "Password:" line, then i tried p

popen and password entry

2006-06-14 Thread sinan nalkaya
hello, i want to use rsync for remote file transfer via popen, but couldnt pass the Password yet. here`s what i did cmd = 'rsync -av config [EMAIL PROTECTED]:/tmp/.' f = os.popen(cmd,'w') f.write('1234') #not worked f.write('1234\n') #not worked every time i see "Password:" line, then i tried p

Re: pop line from file

2006-02-16 Thread Sinan Nalkaya
i am unix platform, now searching for the mkfifo topics. thank you all. -- http://mail.python.org/mailman/listinfo/python-list

pop line from file

2006-02-15 Thread Sinan Nalkaya
hello all, i searched and google long long time but couldnt find any result, i want pop the first line from file, i dont want to read all file contents because file is being updated from another proccess. even i couldnt realize its algorithm, thanks for any suggestion -- http://mail.python.org/mai

Re: about spawn flag

2006-01-31 Thread Sinan Nalkaya
thank you but also i need a pid.also react like an os.P_NOWAIT. if i summarize, child proccess immediately returns the pid, if child exits also returns the exit/error code :) -- http://mail.python.org/mailman/listinfo/python-list

about spawn flag

2006-01-30 Thread Sinan Nalkaya
hi, i am using os.spawn function, it works well but i need a flag that allows function return the process id with exit/error code, is there any or how can i do it, i can replace spawn with fork/exec if necessary. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: make a video from xwd output

2005-12-12 Thread Sinan Nalkaya
On Monday 12 December 2005 03:34 pm, Fredrik Lundh wrote: > Sinan Nalkaya wrote: > > hi i want to write a program that makes a video of my desktop, i think > > that can be via return or output xwd functions in X11 lib then through to > > the mpeg video encoding codes, h

make a video from xwd output

2005-12-12 Thread Sinan Nalkaya
hi i want to write a program that makes a video of my desktop, i think that can be via return or output xwd functions in X11 lib then through to the mpeg video encoding codes, hmm is there an easier solution to this via python? thanks for your attention. -- http://mail.python.org/mailman/listin

Re: need help about time.sleep, timer

2005-11-22 Thread Sinan Nalkaya
Bengt Richter wrote: >On Mon, 21 Nov 2005 10:35:20 +0200, Sinan Nalkaya <[EMAIL PROTECTED]> wrote: > > > >>Dennis Lee Bieber wrote: >> >> >> >>>On Fri, 18 Nov 2005 22:45:37 -0500, Peter Hansen <[EMAIL PROT

Re: termios.tcgetattr(fd) error: (22, 'Invalid argument')

2005-11-21 Thread Sinan Nalkaya
Petr Jakes wrote: >To provide some feedback: >As Grant Edwards posted in this list, I was running my code inside of >IDE that replaces sys.stdin with some other. While running the program >from a shell prompt, everything goes fine. >Petr Jakes > > > have you tried it with root account ? -- h

Re: need help about time.sleep, timer

2005-11-21 Thread Sinan Nalkaya
Dennis Lee Bieber wrote: >On Fri, 18 Nov 2005 22:45:37 -0500, Peter Hansen <[EMAIL PROTECTED]> >declaimed the following in comp.lang.python: > > > >>It's quite unclear whether the last part, above, is one of your >>*requirements*, or a description of a problem you are having with your >>curren

need help about time.sleep, timer

2005-11-18 Thread Sinan Nalkaya
hello, i need a function like that, wait 5 seconds: (during wait) do the function but function waits for keyboard input so if you dont enter any it waits forever. i tried time.sleep() but when i used time.sleep in while, the function in while never executed. then i found something about Timer

Re: get just one character

2005-11-17 Thread Sinan Nalkaya
Paul Watson wrote: >Sinan Nalkaya wrote: > > >>hello everybody, >>how can i just get 1 character ? i`ve done a search but just found >>getch() for windows, i need same for unix and raw_input has any option >>that is not documented ? >>thanks.

get just one character

2005-11-17 Thread Sinan Nalkaya
hello everybody, how can i just get 1 character ? i`ve done a search but just found getch() for windows, i need same for unix and raw_input has any option that is not documented ? thanks. -- http://mail.python.org/mailman/listinfo/python-list

taking x-window screen shot

2005-10-31 Thread Sinan Nalkaya
hi i have some python practice and want to develop tiny prgramme that takes screen shots from command line, im using gnome now but my programme should support the others especially pure X - window. also i want to learn some more about inside when taking screen shots. thanks. -- http://mail.pyth

button design in curses library

2005-10-12 Thread Sinan Nalkaya
hi, im using curses library in my program, i need a button. but i cannot find anything about it. should i do the button via newwin function with bold characters ? any help will be appreciated thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: ncurses programming

2005-09-27 Thread Sinan Nalkaya
thank you very much for your suggestions and links, also slang got my attention. thanks. -- http://mail.python.org/mailman/listinfo/python-list

ncurses programming

2005-09-26 Thread Sinan Nalkaya
hi, i want to use ncurses library in python i`ve found proper library for that, PyNcurses. then i searched for some documentation about ncurses programming, i only found that web site ; http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/ this howto is nice but seems to me, this is for experience

Re: re and escape character

2005-09-16 Thread Sinan Nalkaya
Thomas Guettler wrote: >Am Thu, 15 Sep 2005 14:36:38 +0300 schrieb Sinan Nalkaya: > > > >>i re-format incoming messages like this, >>command = re.findall("^\002(.{2})\|.*\003$", response)[0] >>it works well but when response comes with escape characte

re and escape character

2005-09-15 Thread Sinan Nalkaya
i re-format incoming messages like this, command = re.findall("^\002(.{2})\|.*\003$", response)[0] it works well but when response comes with escape characters , my command variable crashes, i cannot parse if response variable is like , response = '\002AB|TIasdasdasd asdasdasd xzczxc qwewer werwer