Re: how to do draw pattern with python?

2012-09-22 Thread Hans Mulder
On 21/09/12 19:32:20, Ian Kelly wrote: On Fri, Sep 21, 2012 at 10:50 AM, Ismael Farfán sulfur...@gmail.com wrote: 2012/9/21 Peter Otten __pete...@web.de: echo.hp...@gmail.com wrote: print \x1b[2J\x1b[0;0H # optional Nice code : ) Could you dissect that weird string for us? It isn't

how to do draw pattern with python?

2012-09-21 Thread echo . hping
may i know how to shift the bits using only looping and branching?? xx .x..x. ..xx.. ..xx.. .x..x. xx xx ..x..x ...xx. ...xx. ..x..x xx .xx... x..x.. xx xx x..x.. .xx... etc.. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to do draw pattern with python?

2012-09-21 Thread Laszlo Nagy
On 2012-09-21 15:36, echo.hp...@gmail.com wrote: may i know how to shift the bits using only looping and branching?? xx .x..x. ..xx.. ..xx.. .x..x. xx What kinds of bits? What are these points and x-es anyway? Are they strings? Or binary data? I recommend this for reading:

Re: how to do draw pattern with python?

2012-09-21 Thread Mark Lawrence
On 21/09/2012 14:36, echo.hp...@gmail.com wrote: may i know how to shift the bits using only looping and branching?? xx .x..x. ..xx.. ..xx.. .x..x. xx xx ..x..x ...xx. ...xx. ..x..x xx .xx... x..x.. xx xx x..x.. .xx... etc.. You write some code and test it. If it

Re: how to do draw pattern with python?

2012-09-21 Thread Dave Angel
On 09/21/2012 09:36 AM, echo.hp...@gmail.com wrote: may i know how to shift the bits using only looping and branching?? Yes, show us your code, and what isn't working, and we'll try to help you complete the assignment. It'd probably also be good to specify the rest of the homework, like what

Re: how to do draw pattern with python?

2012-09-21 Thread Peter Otten
echo.hp...@gmail.com wrote: may i know how to shift the bits using only looping and branching?? import time data = \ xx .x..x. ..xx.. ..xx.. .x..x. xx .splitlines() data = [line * 12 for line in data] # optional while True: print \x1b[2J\x1b[0;0H # optional for i, line in

Re: how to do draw pattern with python?

2012-09-21 Thread Ismael Farfán
2012/9/21 Peter Otten __pete...@web.de: echo.hp...@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

Re: how to do draw pattern with python?

2012-09-21 Thread Peter Otten
Ismael Farfán wrote: 2012/9/21 Peter Otten __pete...@web.de: echo.hp...@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

Re: how to do draw pattern with python?

2012-09-21 Thread Ian Kelly
On Fri, Sep 21, 2012 at 10:50 AM, Ismael Farfán sulfur...@gmail.com wrote: 2012/9/21 Peter Otten __pete...@web.de: echo.hp...@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

Re: how to do draw pattern with python?

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 2:50 AM, Ismael Farfán sulfur...@gmail.com wrote: 2012/9/21 Peter Otten __pete...@web.de: echo.hp...@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

Re: how to do draw pattern with python?

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 3:31 AM, Chris Angelico ros...@gmail.com wrote: 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.) Ah. From Wikipedia: If n is two, clear

Re: how to do draw pattern with python?

2012-09-21 Thread Mark Lawrence
On 21/09/2012 15:29, Peter Otten wrote: echo.hp...@gmail.com wrote: may i know how to shift the bits using only looping and branching?? import time data = \ xx .x..x. ..xx.. ..xx.. .x..x. xx .splitlines() data = [line * 12 for line in data] # optional while True: print

Re: how to do draw pattern with python?

2012-09-21 Thread Chris Angelico
On Sat, Sep 22, 2012 at 5:55 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: I tried running your code but got this:- c:\Users\Markpattern.py File C:\Users\Mark\pattern.py, line 22 Doing your homework since 2001 ^ SyntaxError: invalid syntax What am I doing wrong?