Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #42824 > unrolled thread
| Started by | mattgraves7@gmail.com |
|---|---|
| First post | 2013-04-05 07:04 -0700 |
| Last post | 2013-04-05 11:39 -0400 |
| Articles | 7 — 6 participants |
Back to article view | Back to comp.lang.python
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
| From | mattgraves7@gmail.com |
|---|---|
| Date | 2013-04-05 07:04 -0700 |
| Subject | Typing letters slowly using sys |
| Message-ID | <44fa9565-c6cd-4a46-ad28-97417b403444@googlegroups.com> |
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.
[toc] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2013-04-05 14:31 +0000 |
| Message-ID | <kjmn77$dmm$1@reader1.panix.com> |
| In reply to | #42824 |
In <44fa9565-c6cd-4a46-ad28-97417b403444@googlegroups.com> mattgraves7@gmail.com 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
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | Grant Edwards <invalid@invalid.invalid> |
|---|---|
| Date | 2013-04-05 14:50 +0000 |
| Message-ID | <kjmoap$obv$1@reader1.panix.com> |
| In reply to | #42824 |
On 2013-04-05, mattgraves7@gmail.com <mattgraves7@gmail.com> 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??
[toc] | [prev] | [next] | [standalone]
| From | Mitya Sirenef <msirenef@lightbird.net> |
|---|---|
| Date | 2013-04-05 10:52 -0400 |
| Message-ID | <mailman.143.1365173532.3114.python-list@python.org> |
| In reply to | #42824 |
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/
[toc] | [prev] | [next] | [standalone]
| From | Matt <mattgraves7@gmail.com> |
|---|---|
| Date | 2013-04-05 08:10 -0700 |
| Message-ID | <b7680abc-4566-4aad-9426-9d80881899bd@googlegroups.com> |
| In reply to | #42824 |
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
[toc] | [prev] | [next] | [standalone]
| From | John Gordon <gordon@panix.com> |
|---|---|
| Date | 2013-04-05 15:14 +0000 |
| Message-ID | <kjmpoc$kdl$1@reader1.panix.com> |
| In reply to | #42831 |
In <b7680abc-4566-4aad-9426-9d80881899bd@googlegroups.com> Matt <mattgraves7@gmail.com> 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
gordon@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
[toc] | [prev] | [next] | [standalone]
| From | inq1ltd <inq1ltd@inqvista.com> |
|---|---|
| Date | 2013-04-05 11:39 -0400 |
| Message-ID | <mailman.148.1365178558.3114.python-list@python.org> |
| In reply to | #42831 |
[Multipart message — attachments visible in raw view] — view raw
On Friday, April 05, 2013 08:10:53 AM Matt wrote:
> 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
if you can write the dots on one one line, then try writing the word
with an additional dot.
Loading .
Loading . .
Loading . . .
in other words, over write the word Loading with one
additional dot each time a dot is called for.
jd
inqvista.com
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web