Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Typing letters slowly using sys

Reply
Thread Tools

Typing letters slowly using sys

 
 
mattgraves7@gmail.com
Guest
Posts: n/a
 
      04-05-2013
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.
 
Reply With Quote
 
 
 
 
John Gordon
Guest
Posts: n/a
 
      04-05-2013
In <(E-Mail Removed)> http://www.velocityreviews.com/forums/(E-Mail Removed) writes:

> 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.


How are you printing the "Loading" text? (It would have helped a lot to
show us that code.)

--
John Gordon A is for Amy, who fell down the stairs
(E-Mail Removed) B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

 
Reply With Quote
 
 
 
 
Grant Edwards
Guest
Posts: n/a
 
      04-05-2013
On 2013-04-05, (E-Mail Removed) <(E-Mail Removed)> wrote:

> dots = ('............')
> for x in dots:
> sys.stdout.write(x)
> sys.stdout.flush()
> time.sleep(0.2)


That works just fine for me using Python 2.4, 2.6, 2.7 and 3.2.

--
Grant Edwards grant.b.edwards Yow! Is it 1974? What's
at for SUPPER? Can I spend
gmail.com my COLLEGE FUND in one
wild afternoon??
 
Reply With Quote
 
Mitya Sirenef
Guest
Posts: n/a
 
      04-05-2013
On 04/05/2013 10:04 AM, (E-Mail Removed) 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/

 
Reply With Quote
 
Matt
Guest
Posts: n/a
 
      04-05-2013
On Friday, April 5, 2013 10:04:49 AM UTC-4, Matt 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.


Sorry guys, I may have not been clear. The part I pasted does work, but I cannot figure out how to get that to print after the word "Loading". So it will instantly print "Loading", and then the "..........." will appear slowly
 
Reply With Quote
 
John Gordon
Guest
Posts: n/a
 
      04-05-2013
In <(E-Mail Removed)> Matt <(E-Mail Removed)> writes:

> Sorry guys, I may have not been clear. The part I pasted does work, but
> I cannot figure out how to get that to print after the word "Loading". So
> it will instantly print "Loading", and then the "..........." will appear
> slowly


Have you tried:

sys.stdout.write('Loading')
sys.stdout.flush()

--
John Gordon A is for Amy, who fell down the stairs
(E-Mail Removed) B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Typing to Nullable (Of Date) vs typing to Date JimLad ASP .Net 0 01-26-2010 07:54 PM
typing location changes when I am typing. Ed Computer Support 5 11-11-2006 12:51 AM
Static Typing Where Possible and Dynamic Typing When Needed vladare Ruby 0 07-11-2005 11:54 AM
comp.sys.mac.games.misc,comp.sys.ibm.pc.hardware.misc,comp.mail.pegasus-mail.ms-windows,comp.databases.paradox,comp.dcom.sys.cisco . Cisco 0 06-19-2004 07:48 AM
Changing from capital letters to small letters using perl Venugopal Perl Misc 11 11-05-2003 06:07 PM



Advertisments