Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #103458
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Emile van Sebille <emile@fenx.com> |
| Newsgroups | comp.lang.python |
| Subject | Re: child.before taking almost 1 minute to execute |
| Date | Wed, 24 Feb 2016 12:57:31 -0800 |
| Lines | 20 |
| Message-ID | <mailman.104.1456347518.20994.python-list@python.org> (permalink) |
| References | <ae3896fc-10e2-436f-aaac-bfb201f83c81@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de ntnVfTxvXIvXeR1hBSFy1wZS+dpxsYGJ7GeMBNeUv1qQ== |
| Return-Path | <python-python-list@m.gmane.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.004 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; "'no": 0.09; 'eof': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'snippet': 0.09; 'result.': 0.15; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'sys.exit(1)': 0.16; 'timeout,': 0.16; 'wrote:': 0.16; 'skip:% 10': 0.22; 'am,': 0.23; 'header:In-Reply- To:1': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints- To:1': 0.26; 'looks': 0.29; '"no': 0.29; 'print': 0.30; "i'd": 0.31; 'guess': 0.31; 'file': 0.34; 'skip:p 30': 0.35; 'there': 0.36; 'alone': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'wrong': 0.38; 'skip:o 20': 0.38; 'to:addr:python.org': 0.40; 'your': 0.60; 'charset:windows-1252': 0.62; 'complete': 0.63; 'received:12': 0.81; 'subject:minute': 0.84 |
| X-Injected-Via-Gmane | http://gmane.org/ |
| X-Gmane-NNTP-Posting-Host | www.westernstatesglass.com |
| User-Agent | Mozilla/5.0 (Windows NT 6.2; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
| In-Reply-To | <ae3896fc-10e2-436f-aaac-bfb201f83c81@googlegroups.com> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.21rc2 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Xref | csiph.com comp.lang.python:103458 |
Show key headers only | View raw
On 2/24/2016 7:42 AM, pyfreek wrote:
> The following snippet alone is taking 1 minute to execute. is there any best way to find 'No such file' other than using child.before
>
> if not scrutinFile.startswith('/') :
> scrutinFile = '/'+ scrutinFile
> scrutinFileFtp = directory + scrutinFile
> filePath, file = os.path.split(scrutinFileFtp)
> p.sendline('cd %s'%(filePath))
> p.expect([pexpect.EOF,pexpect.TIMEOUT])
> if 'No such file' in p.before:
> print "No such directory exists!!"
> sys.exit(1)
I'd guess that you've got your p.expect line wrong -- it looks to me
like you're allowing that line to complete only upon seeing an EOF or
TIMEOUT, and that it's timing out as a result.
Emile
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
child.before taking almost 1 minute to execute pyfreek <sruthi223@gmail.com> - 2016-02-24 07:42 -0800
Re: child.before taking almost 1 minute to execute Emile van Sebille <emile@fenx.com> - 2016-02-24 12:57 -0800
Re: child.before taking almost 1 minute to execute sruthi223@gmail.com - 2016-02-25 07:12 -0800
Re: child.before taking almost 1 minute to execute Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-02-25 10:09 +1300
Re: child.before taking almost 1 minute to execute sruthi223@gmail.com - 2016-02-25 07:12 -0800
csiph-web