Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #34661
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <joel.goldstick@gmail.com> |
| 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; 'example:': 0.03; 'skip:" 60': 0.05; 'python': 0.09; 'email addr:example.com': 0.09; 'fix.': 0.09; 'cc:addr:python-list': 0.10; 'dec': 0.15; 'row': 0.16; 'subject:Problem': 0.16; 'subject:screen': 0.16; 'wrote:': 0.17; 'email addr:gmail.com>': 0.20; 'import': 0.21; 'strip': 0.22; 'received:74.125.82.174': 0.23; 'cc:2**0': 0.23; 'command': 0.24; 'script': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'mike': 0.27; 'skip:# 10': 0.27; 'message- id:@mail.gmail.com': 0.27; 'correct': 0.28; 'skip:( 20': 0.28; 'skip:& 70': 0.29; 'url:mailman': 0.29; 'character': 0.29; 'included': 0.29; 'url:python': 0.32; 'file': 0.32; "skip:' 20": 0.32; 'print': 0.32; 'url:listinfo': 0.32; 'received:74.125.82': 0.33; '11,': 0.33; 'problem': 0.33; 'received:google.com': 0.34; 'text': 0.34; 'thanks': 0.34; 'open': 0.35; 'pm,': 0.35; 'next': 0.35; 'received:74.125': 0.36; 'url:org': 0.36; 'subject:with': 0.36; 'subject:: ': 0.38; 'shows': 0.38; 'instead': 0.39; 'hello,': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'url:mail': 0.40; 'your': 0.60; 'joel': 0.91; 'divided': 0.93 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=yuqdtHc/AY3FfhAo6mcJy+faZXxptOS8YgddhsUqsbs=; b=xdyoev47eZ52ihwghYTz5HkXoMkBTTD9pypmKJOzAiWRtmNkMBnalOnrk1gOQB3isE U1tP/GWpwa6friEKrffp8yGqqxEmxSwF1Wt1AipUeVmrij7Xf06yIq4oG5ojDiE4qTKb 3/Hy3imcBaoAPmubpIRGCv37Ict/IcMLCrn3lGkQNAUDSzHn358oqDdbzO3u5MeN1qEJ TaGiU1bM0MDNIL5+noUo0FTSQuZ72FlpFgHxbajfLLuxDgZJHbqalN/Px4l/302JdbiI agytgruWV/A+cAnDu1Qvgqmzs/QGGAUqGZ9Z6yqpsjEXWVwN+MFxvQH1UwyX+sK6Eyvc GT/A== |
| MIME-Version | 1.0 |
| In-Reply-To | <37e2ba70-a709-4888-9672-be30956d690d@googlegroups.com> |
| References | <37e2ba70-a709-4888-9672-be30956d690d@googlegroups.com> |
| Date | Tue, 11 Dec 2012 17:53:37 -0500 |
| Subject | Re: Problem with print and output to screen |
| From | Joel Goldstick <joel.goldstick@gmail.com> |
| To | Mike <miguelcoam@gmail.com> |
| Content-Type | multipart/alternative; boundary=089e0122896c6aa3cb04d09b8d9c |
| Cc | "python-list@python.org" <python-list@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.754.1355266426.29569.python-list@python.org> (permalink) |
| Lines | 105 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1355266426 news.xs4all.nl 6906 [2001:888:2000:d::a6]:37516 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:34661 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
When you read the file line by line the end of line character is included
in the result
try user[:-1] instead to strip the return from your printed text
On Tue, Dec 11, 2012 at 5:31 PM, Mike <miguelcoam@gmail.com> wrote:
> Hello, I am learning python and i have the next problem and i not
> understand how fix.
> The script is very simple, shows in the terminal the command but, the row
> is divided in two:
> Example:
>
>
> /opt/zimbra/bin/zmprov ga user@example.com
> |egrep
> "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)"
> /opt/zimbra/bin/zmprov ga user2@example.com
> |egrep
> "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)"
>
> And the correct is:
> /opt/zimbra/bin/zmprov ga user@example.com |egrep
> "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)"
>
>
> The script is:
>
> #!/usr/bin/python
> import os
>
> for user in open ("email"):
> print '/opt/zimbra/bin/zmprov ga ' + user + '|egrep
> "(zimbraPrefMailForwardingAddress:|zimbraPrefMailForwardingAddress:)" '
>
>
>
> Thanks
> --
> http://mail.python.org/mailman/listinfo/python-list
>
--
Joel Goldstick
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Problem with print and output to screen Mike <miguelcoam@gmail.com> - 2012-12-11 14:31 -0800
Re: Problem with print and output to screen Dave Angel <d@davea.name> - 2012-12-11 17:48 -0500
Re: Problem with print and output to screen Joel Goldstick <joel.goldstick@gmail.com> - 2012-12-11 17:53 -0500
Re: Problem with print and output to screen Dave Angel <d@davea.name> - 2012-12-11 18:00 -0500
Re: Problem with print and output to screen Joel Goldstick <joel.goldstick@gmail.com> - 2012-12-11 18:07 -0500
Re: Problem with print and output to screen Mike <miguelcoam@gmail.com> - 2012-12-11 16:44 -0800
Re: Problem with print and output to screen Mike <miguelcoam@gmail.com> - 2012-12-11 16:44 -0800
csiph-web