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


Groups > comp.lang.python > #42828

Re: Typing letters slowly using sys

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 <msirenef@lightbird.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.042
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'sys': 0.07; 'python:': 0.09; 'subject:using': 0.09; 'dots': 0.16; 'periods': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'basically': 0.19; 'typing': 0.19; 'appears': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'appear': 0.29; 'am,': 0.29; 'loading': 0.31; 'received:192.168.1.3': 0.31; 'figure': 0.32; 'next': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'letters': 0.60; 'most': 0.60; "you're": 0.61; 'email addr:gmail.com': 0.63; 'show': 0.63; 'happen': 0.63; 'life': 0.66; 'instantly': 0.84; 'do:': 0.91; 'have.': 0.93
Date Fri, 05 Apr 2013 10:52:07 -0400
From Mitya Sirenef <msirenef@lightbird.net>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4
MIME-Version 1.0
To python-list@python.org
Subject Re: Typing letters slowly using sys
References <44fa9565-c6cd-4a46-ad28-97417b403444@googlegroups.com>
In-Reply-To <44fa9565-c6cd-4a46-ad28-97417b403444@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
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 <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.143.1365173532.3114.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1365173532 news.xs4all.nl 6841 [2001:888:2000:d::a6]:44064
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:42828

Show key headers only | View raw


On 04/05/2013 10:04 AM, mattgraves7@gmail.com wrote:
> I am using sys to give the effect that I am typing letters slowly. Basically what I want to have happen is have it show "Loading......" with the word loading appearing instantly and then the periods appearing slowly, as most loading screens do.
> This is what I have.
>
> dots = ('............')
> for x in dots:
>       sys.stdout.write(x)
>       sys.stdout.flush()
>       time.sleep(0.2)
> 				
> I cannot for the life of me figure out how to get the dots to appear on the same line as "Loading". Every way that I have attempted, the word "Loading" appears and then the dots appear on the next line.

If you're printing in 2.x, you can do:

print "Loading",

in 3.x,

print("Loading", end='')

  -m

-- 
Lark's Tongue Guide to Python: http://lightbird.net/larks/

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


Thread

Typing letters slowly using sys mattgraves7@gmail.com - 2013-04-05 07:04 -0700
  Re: Typing letters slowly using sys John Gordon <gordon@panix.com> - 2013-04-05 14:31 +0000
  Re: Typing letters slowly using sys Grant Edwards <invalid@invalid.invalid> - 2013-04-05 14:50 +0000
  Re: Typing letters slowly using sys Mitya Sirenef <msirenef@lightbird.net> - 2013-04-05 10:52 -0400
  Re: Typing letters slowly using sys Matt <mattgraves7@gmail.com> - 2013-04-05 08:10 -0700
    Re: Typing letters slowly using sys John Gordon <gordon@panix.com> - 2013-04-05 15:14 +0000
    Re: Typing letters slowly using sys inq1ltd <inq1ltd@inqvista.com> - 2013-04-05 11:39 -0400

csiph-web