τσέκαρε την pexpect http://www.noah.org/wiki/Pexpect
δεν είναι στην standard library
Συντονιστής: konnn




#!/usr/bin/python
# -*- coding: utf-8 -*-
import pexpect
import sys, getpass
c = pexpect.spawn ('encfs ~/.test ~/test')
c.expect ('EncFS Password: ')
c.send ('password')chris@chris-Aspire-5732Z:~/Προγραμματισμός/PYTHON$ ./pexpect-example.py
Traceback (most recent call last):
File "./pexpect-example.py", line 8, in <module>
c.expect ('EncFS Password: ')
File "/usr/local/lib/python2.7/dist-packages/pexpect.py", line 1311, in expect
return self.expect_list(compiled_pattern_list, timeout, searchwindowsize)
File "/usr/local/lib/python2.7/dist-packages/pexpect.py", line 1325, in expect_list
return self.expect_loop(searcher_re(pattern_list), timeout, searchwindowsize)
File "/usr/local/lib/python2.7/dist-packages/pexpect.py", line 1396, in expect_loop
raise EOF (str(e) + '\n' + str(self))
pexpect.EOF: End Of File (EOF) in read_nonblocking(). Exception style platform.
<pexpect.spawn object at 0xb77adcec>
version: 2.3 ($Revision: 399 $)
command: /usr/bin/encfs
args: ['/usr/bin/encfs', '~/.test', '~/test']
searcher: searcher_re:
0: re.compile("EncFS Password: ")
buffer (last 100 chars):
before (last 100 chars): age in ~/.crypt :
encfs ~/.crypt ~/crypt
For more information, see the man page encfs(1)
after: <class 'pexpect.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 2849
child_fd: 3
closed: False
timeout: 30
delimiter: <class 'pexpect.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1





