Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'escape': 0.07; 'responding': 0.07; '22,': 0.09; 'cursor': 0.09; 'sep': 0.09; 'subset': 0.09; 'subject:python': 0.11; 'sat,': 0.15; 'weird': 0.15; 'clears': 0.16; 'code?': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'screen,': 0.16; 'sequence,': 0.16; 'string': 0.17; 'wrote:': 0.17; 'instance,': 0.17; 'do.': 0.21; 'implicit': 0.22; 'parse': 0.22; 'second': 0.24; 'header:In- Reply-To:1': 0.25; 'looks': 0.26; 'am,': 0.27; 'executing': 0.27; 'message-id:@mail.gmail.com': 0.27; 'ansi': 0.29; 'optional': 0.29; "i'm": 0.29; 'maybe': 0.29; 'code': 0.31; 'could': 0.32; 'print': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'returning': 0.35; 'subject:?': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'depends': 0.36; 'subject:with': 0.36; 'two': 0.37; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'most': 0.61; 'first': 0.61; 'email addr:gmail.com': 0.63; 'color': 0.69; 'otten': 0.84; 'us?': 0.91 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 :content-type:content-transfer-encoding; bh=5BAsVrr7NqBoESAjAitJw+nWVVkHbRiXMHpM3hiLfMM=; b=fnDCrzhPwqY643PSJYlwXPGj+eIkaCf7X0liuGAkEWj9MLigYUlHAHwegKvJTgucwE PBAZhGCyJT3I4Xxjki9eizy+fHKz5mQXMpAbeu44T4dENQQ6uB2bxLBQ9kFtJGsR/31n B34Hw2sumS7/vbS/OYcIALBIPMLwOgNAO85/pkSIm+eYee9GbUk+YgUik+SIISIDChHg WeEhY0ZH+39EY5xsyVCKzp/RrTmk/PRJBs+IKN3jSa3DPN6rACZPx62Qyeh2Hxy8VuHp vb3sR7lhhKPUxxbrhVillJJRuiQ7G/4mIg1Ese06OqgGgsoKzftRf5KnlNOAeEAVl5UJ ZgNQ== MIME-Version: 1.0 In-Reply-To: References: Date: Sat, 22 Sep 2012 03:31:54 +1000 Subject: Re: how to do draw pattern with python? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 1348248717 news.xs4all.nl 6900 [2001:888:2000:d::a6]:46770 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29657 On Sat, Sep 22, 2012 at 2:50 AM, Ismael Farf=E1n wrot= e: > 2012/9/21 Peter Otten <__peter__@web.de>: >> echo.hping@gmail.com wrote: >> >> print "\x1b[2J\x1b[0;0H" # optional > > Nice code : ) > > Could you dissect that weird string for us? > > It isn't returning the cursor to (0,0), it's just like executing > clear(1), and looks like those line coloring scape sequences for bash. It's an ANSI escape sequence, or rather two of them. The first one clears the screen, the second returns you to 0,0. (Isn't that implicit in the 2J code? Maybe I'm misremembering.) But it depends on the terminal responding to them, and not all terminals do. For instance, most MUD clients parse only a very small subset of ANSI codes, eg color codes only. ChrisA