Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'escape': 0.07; 'formatting': 0.07; 'sequences.': 0.07; 'missed': 0.09; 'python': 0.09; '"%s"': 0.09; 'tuple': 0.09; 'tuple.': 0.09; 'library': 0.15; 'passing': 0.15; 'at.': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'hmm.': 0.16; 'subject:Formatting': 0.16; 'twice.': 0.16; 'string': 0.17; 'wrote:': 0.17; 'string,': 0.17; 'variables': 0.17; 'variable': 0.20; '2.x': 0.22; 'ones.': 0.22; 'pass': 0.25; 'header:In-Reply- To:1': 0.25; 'header:User-Agent:1': 0.26; 'lines': 0.28; 'didnt': 0.29; 'quoting': 0.29; 'this.': 0.29; 'basic': 0.30; 'function': 0.30; 'url:python': 0.32; 'suggestion': 0.32; 'getting': 0.33; "he's": 0.33; 'to:addr:python-list': 0.33; 'pm,': 0.35; 'something': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'message-id:@gmail.com': 0.36; 'url:org': 0.36; 'modules': 0.36; 'url:library': 0.36; 'method': 0.36; 'display': 0.36; 'does': 0.37; 'two': 0.37; 'subject:: ': 0.38; 'url:docs': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'called': 0.39; 'google': 0.39; 'received:192.168': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'dont': 0.64; 'talking': 0.66; 'special': 0.73; 'subject:value': 0.84; 'understood.': 0.84 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Sat, 26 Jan 2013 15:26:44 -0700 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20121115 Thunderbird/10.0.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Formatting a column's value output References: <6ad78df4-0ec0-4760-8f5a-5ecf129c5e65@googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1359239220 news.xs4all.nl 6897 [2001:888:2000:d::a6]:40228 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37741 On 01/26/2013 12:41 PM, Ferrous Cranus wrote: > I can use triple (''') quoting so i dont have to escape special characters. Hmm. I think you missed what he was getting at. He's not talking about Python escape sequences. He's talking about HTML ones. There is a function in one of the standard library modules that does this. I think it's called html_sanitize or something. Google will find this. > But i didnt understand you suggestion about the tuple. What don't you understand about it? It's basic python string formatting (well python 2.x string formatting). http://docs.python.org/2/library/stdtypes.html#string-formatting-operations A tuple is one method for passing variables into the string formatter. So if you need to display something twice, just put in two "%s" in the format string, and pass it the same variable twice. > The dataset returns many lines and i need to transfor only the URL column.... > Sorry i did not understood.