Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #29666

Re: how to do draw pattern with python?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
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.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'syntax': 0.03; 'bits': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:python': 0.11; '"""\\': 0.16; 'looping': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'syntaxerror:': 0.16; 'true:': 0.16; 'wrote:': 0.17; '2001': 0.17; 'import': 0.21; 'tried': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'skip:" 20': 0.26; 'header:X -Complaints-To:1': 0.28; 'optional': 0.29; 'code': 0.31; 'file': 0.32; 'from:addr:yahoo.co.uk': 0.32; 'running': 0.32; 'print': 0.32; 'shift': 0.33; 'to:addr:python-list': 0.33; 'doing': 0.35; 'subject:?': 0.35; 'received:org': 0.36; 'but': 0.36; 'subject:with': 0.36; 'data': 0.37; 'subject:: ': 0.38; 'mark': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'email addr:gmail.com': 0.63; 'otten': 0.84; 'received:2': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: how to do draw pattern with python?
Date Fri, 21 Sep 2012 20:55:02 +0100
References <c35280cc-4b70-4030-b040-bafba2eacdd0@googlegroups.com> <k3htib$g7s$1@ger.gmane.org>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host host-2-97-73-254.as13285.net
User-Agent Mozilla/5.0 (Windows NT 6.0; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
In-Reply-To <k3htib$g7s$1@ger.gmane.org>
X-Antivirus avast! (VPS 120921-0, 21/09/2012), Outbound message
X-Antivirus-Status Clean
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.1029.1348257273.27098.python-list@python.org> (permalink)
Lines 44
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1348257273 news.xs4all.nl 6928 [2001:888:2000:d::a6]:35576
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:29666

Show key headers only | View raw


On 21/09/2012 15:29, Peter Otten wrote:
> echo.hping@gmail.com wrote:
>
>> may i know how to shift the bits using only looping and branching??
>
> import time
>
> data = """\
> x....x
> .x..x.
> ..xx..
> ..xx..
> .x..x.
> x....x
>
> """.splitlines()
>
> data = [line * 12 for line in data] # optional
>
> while True:
>      print "\x1b[2J\x1b[0;0H" # optional
>      for i, line in enumerate(data):
>          print line
>          data[i] = line[1:] + line[:1]
>      time.sleep(.1)
>
> Doing your homework since 2001 ;)
>

I tried running your code but got this:-

c:\Users\Mark>pattern.py
   File "C:\Users\Mark\pattern.py", line 22
     Doing your homework since 2001
              ^
SyntaxError: invalid syntax

What am I doing wrong?

-- 
Cheers.

Mark Lawrence.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to do draw pattern with python? echo.hping@gmail.com - 2012-09-21 06:36 -0700
  Re: how to do draw pattern with python? Laszlo Nagy <gandalf@shopzeus.com> - 2012-09-21 15:54 +0200
  Re: how to do draw pattern with python? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-21 14:55 +0100
  Re: how to do draw pattern with python? Dave Angel <d@davea.name> - 2012-09-21 10:00 -0400
  Re: how to do draw pattern with python? Peter Otten <__peter__@web.de> - 2012-09-21 16:29 +0200
  Re: how to do draw pattern with python? Ismael Farfán <sulfurfff@gmail.com> - 2012-09-21 11:50 -0500
  Re: how to do draw pattern with python? Peter Otten <__peter__@web.de> - 2012-09-21 19:29 +0200
  Re: how to do draw pattern with python? Chris Angelico <rosuav@gmail.com> - 2012-09-22 03:31 +1000
  Re: how to do draw pattern with python? Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-21 11:32 -0600
    Re: how to do draw pattern with python? Hans Mulder <hansmu@xs4all.nl> - 2012-09-22 21:34 +0200
  Re: how to do draw pattern with python? Chris Angelico <rosuav@gmail.com> - 2012-09-22 03:35 +1000
  Re: how to do draw pattern with python? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-21 20:55 +0100
  Re: how to do draw pattern with python? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-21 16:12 -0400
  Re: how to do draw pattern with python? Chris Angelico <rosuav@gmail.com> - 2012-09-22 13:08 +1000

csiph-web