[Tutor] Re: Tutor digest, Vol 1 #466 - 7 msgs

Jerry Killion jkillion@mipscorp.com
Wed, 08 Nov 2000 14:10:57 -0500


I ran the sleep method under pythonwin 1.5 and it doesn't act like what i would
expect - the sleep method seems to run prior to printing - can you explain why?

thanks

tutor-request@python.org wrote:

> Send Tutor mailing list submissions to
>         tutor@python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://www.python.org/mailman/listinfo/tutor
> or, via email, send a message with subject or body 'help' to
>         tutor-request@python.org
>
> You can reach the person managing the list at
>         tutor-admin@python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Tutor digest..."
>
> Today's Topics:
>
>    1. Re: I want to sign up... (Gerrit Haase)
>    2. Re: joining mailing list (Gerrit Haase)
>    3. tkinter newbie problem (wheelege)
>    4. Re: Python 2.0 newbie questions (Glenn T. Norton)
>    5. really really silly question (wheelege)
>    6. RE: really really silly question (Doug Stanfield)
>    7. Re: really really silly question (wheelege)
>
> --__--__--
>
> Message: 1
> From: "Gerrit Haase" <gerrit.haase@t-online.de>
> Organization: Esse keine toten Tiere
> To: Dania Lorena <danialorena@yahoo.com>, tutor@python.org
> Date: Sat, 28 Oct 2000 03:41:45 +0200
> Subject: Re: [Tutor] I want to sign up...
>
> Von:                    Dania Lorena <danialorena@yahoo.com>
> An:                     tutor@python.org
> Betreff:                [Tutor] I want to sign up...
> Datum:          Wed, 25 Oct 2000 14:27:03 -0700 (PDT)
>
> > For tutoring in python.
> > My name is Dania Martinez
> > danialorena@yahoo.com
> >
>
> I see, there is no answer yet, so I do it:
>
> look here to subscribe:
> http://www.python.org/mailman/listinfo/tutor
>
> - gph -
>
> --
> Gerrit Peter Haase
>
> --__--__--
>
> Message: 2
> From: "Gerrit Haase" <gerrit.haase@t-online.de>
> Organization: Esse keine toten Tiere
> To: "Stahl, Carissa" <Carissa.Stahl@icn.siemens.com>,
>         "'tutor@python.org'" <tutor@python.org>
> Date: Sat, 28 Oct 2000 03:44:57 +0200
> Subject: Re: [Tutor] joining mailing list
>
> Von:                    "Stahl, Carissa" <Carissa.Stahl@icn.siemens.com>
> An:                     "'tutor@python.org'" <tutor@python.org>
> Betreff:                [Tutor] joining mailing list
> Datum:          Mon, 23 Oct 2000 13:44:14 -0400
>
> > Please place me on your mailing list...
> > carissa.stahl@icn.siemens.com
> >
> > _______________________________________________
> > Tutor maillist  -  Tutor@python.org
> > http://www.python.org/mailman/listinfo/tutor
>
> I see, there is no answer yet, so I do it:
>
> look here to subscribe:
> http://www.python.org/mailman/listinfo/tutor
>
> - gph -
>
> --
> Gerrit Peter Haase
>
> --__--__--
>
> Message: 3
> From: "wheelege" <wheelege@tsn.cc>
> To: <tutor@python.org>
> Date: Sat, 28 Oct 2000 13:05:08 +1000
> Subject: [Tutor] tkinter newbie problem
>
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_0037_01C040DF.B2E04220
> Content-Type: text/plain;
>         charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
>   Hi all.  This is probably so mind-numbingly simple but hey - I'm a =
> newbie.
>
> can anyone see any problems with this?
>
> from Tkinter import *
> root =3D Tk()
> root.title("I'm a Tkinter Program !")
>
> mBar =3D Frame(root, relief=3DRAISED, borderwidth=3D2)
> mBar.pack(fill=3DX)
> CmdBtn =3D makeCommandMenu()
> mBar.tk_menuBar(CmdBtn)#, CasBtn, ChkBtn, RadBtn, NoMenu)
> def makeCommandMenu():
>     CmdBtn =3D Menubutton(mBar, text=3D'Button Commands', underline=3D0)
>     CmdBtn.pack(side=3DLEFT, padx=3D"2m")
>     CmdBtn.menu =3D Menu(CmdBtn)
>     CmdBtn.menu.add_command(label=3D"Undo")
>     CmdBtn.menu.entryconfig(0, state=3DDISABLED)
>     CmdBtn.menu.add_command(label=3D'New...', underline=3D0, =
> command=3Dnew_file)
>     CmdBtn.menu.add_command(label=3D'Open...', underline=3D0, =
> command=3Dopen_file)
>     CmdBtn.menu.add_command(label=3D'Wild Font', underline=3D0,
>                             font=3D('Tempus Sans ITC', 14), =
> command=3Dstub_action)
>     CmdBtn.menu.add_command(bitmap=3D"@bitmaps/RotateLeft")
>     CmdBtn.menu.add('separator')
>     CmdBtn.menu.add_command(label=3D'Quit', underline=3D0,
>                             background=3D'white', =
> activebackground=3D'green',
>                             command=3DCmdBtn.quit)
>     print 'bitch'
>     CmdBtn['menu'] =3D CmdBtn.menu
>     return CmdBtn
>
> root.mainloop()
>
> This is almost exactly copied from John Grayson's book, but I cut some =
> things from it.
> I'm using Python 2.0.  It keeps telling me there is an error with the =
> makeCommandMenu thing,
> says there is no such variable as mbar.
>
> Help!
>
> ------=_NextPart_000_0037_01C040DF.B2E04220
> Content-Type: text/html;
>         charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html; =
> charset=3Diso-8859-1">
> <META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV>&nbsp; Hi all.&nbsp; This is probably so mind-numbingly simple but =
> hey -=20
> I'm a newbie.</DIV>
> <DIV>&nbsp;</DIV>
> <DIV>can anyone see any problems with this?</DIV>
> <DIV>&nbsp;</DIV>
> <DIV>from Tkinter import *<BR>root =3D Tk()<BR>root.title("I'm a Tkinter =
> Program=20
> !")</DIV>
> <DIV>&nbsp;</DIV>
> <DIV>mBar =3D Frame(root, relief=3DRAISED,=20
> borderwidth=3D2)<BR>mBar.pack(fill=3DX)<BR>CmdBtn =3D=20
> makeCommandMenu()<BR>mBar.tk_menuBar(CmdBtn)#, CasBtn, ChkBtn, RadBtn,=20
> NoMenu)<BR>def makeCommandMenu():<BR>&nbsp;&nbsp;&nbsp; CmdBtn =3D=20
> Menubutton(mBar, text=3D'Button Commands', =
> underline=3D0)<BR>&nbsp;&nbsp;&nbsp;=20
> CmdBtn.pack(side=3DLEFT, padx=3D"2m")<BR>&nbsp;&nbsp;&nbsp; CmdBtn.menu =
> =3D=20
> Menu(CmdBtn)<BR>&nbsp;&nbsp;&nbsp;=20
> CmdBtn.menu.add_command(label=3D"Undo")<BR>&nbsp;&nbsp;&nbsp;=20
> CmdBtn.menu.entryconfig(0, state=3DDISABLED)<BR>&nbsp;&nbsp;&nbsp;=20
> CmdBtn.menu.add_command(label=3D'New...', underline=3D0,=20
> command=3Dnew_file)<BR>&nbsp;&nbsp;&nbsp; =
> CmdBtn.menu.add_command(label=3D'Open...',=20
> underline=3D0, command=3Dopen_file)<BR>&nbsp;&nbsp;&nbsp;=20
> CmdBtn.menu.add_command(label=3D'Wild Font',=20
> underline=3D0,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
> nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
> bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
> font=3D('Tempus Sans ITC', 14), =
> command=3Dstub_action)<BR>&nbsp;&nbsp;&nbsp;=20
> CmdBtn.menu.add_command(bitmap=3D"@bitmaps/RotateLeft")<BR>&nbsp;&nbsp;&n=
> bsp;=20
> CmdBtn.menu.add('separator')<BR>&nbsp;&nbsp;&nbsp;=20
> CmdBtn.menu.add_command(label=3D'Quit',=20
> underline=3D0,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
> nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
> bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
> background=3D'white',=20
> activebackground=3D'green',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
> nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
> command=3DCmdBtn.quit)<BR>&nbsp;&nbsp;&nbsp; print =
> 'bitch'<BR>&nbsp;&nbsp;&nbsp;=20
> CmdBtn['menu'] =3D CmdBtn.menu<BR>&nbsp;&nbsp;&nbsp; return =
> CmdBtn<BR></DIV>
> <DIV>root.mainloop()<BR></DIV>
> <DIV>This is almost exactly copied from John Grayson's book, but I cut =
> some=20
> things from it.</DIV>
> <DIV>I'm using Python 2.0.&nbsp; It keeps telling me there is an error =
> with the=20
> makeCommandMenu thing,</DIV>
> <DIV>says there is no such variable as mbar.</DIV>
> <DIV>&nbsp;</DIV>
> <DIV>Help!</DIV></BODY></HTML>
>
> ------=_NextPart_000_0037_01C040DF.B2E04220--
>
> --__--__--
>
> Message: 4
> Date: Fri, 27 Oct 2000 20:35:44 -0700
> From: "Glenn T. Norton" <gtnorton@earthlink.net>
> To: tutor@python.org
> Subject: Re: [Tutor] Python 2.0 newbie questions
>
> alan.gauld@bt.com wrote:
>
> > > First make sure your path is set. Here's what I have(on Win98): SET
> > > PATH=C:\PYTHON20;%PATH%
> >
> > > Create a folder in the Python directory, such as "mypython".
> > > Create the file, such as "hello.py"
> > > Save it in the "mypython" directory.
> >
> > >In which case you should also add to your AUTOEXEC:
> > >SET PYTHONPATH=C:\PYTHON20\MYPYTHON
>
>    > Then you don't need to do this:
>    > Go to the command line, IDLE or PythonWin and at the prompt, type...
>    > import os
>    > os.chdir('C:\PYTHON20\MYPYTHON')    #make sure to include the single
>    > quotes
>
>     Is this in anyway wrong? meaning is it dangerous or flatout wrong
>     to import modules this way?. I just find that it's a little quicker to
> use
>     "import os/os.chdir(' ')" and include the path in the IDLE path
> browser
>     than to add to my already bloated AUTOEXEC and reboot windows
>     everytime I create a new project folder.
>
>     Looking forward to the your book.
>     Regards,
>     gtnorton
>
> >
> >
> >
>
> --__--__--
>
> Message: 5
> From: "wheelege" <wheelege@tsn.cc>
> To: <tutor@python.org>
> Date: Sun, 29 Oct 2000 00:40:35 +1000
> Subject: [Tutor] really really silly question
>
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_0040_01C04140.DA25DA00
> Content-Type: text/plain;
>         charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
>   I saw the sleep command in the python documentation and tried to use =
> it - but no matter how hard I try I get an error saying the variable =
> 'sleep' does not exist.  Help!
>
> ------=_NextPart_000_0040_01C04140.DA25DA00
> Content-Type: text/html;
>         charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html; =
> charset=3Diso-8859-1">
> <META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
> <STYLE></STYLE>
> </HEAD>
> <BODY bgColor=3D#ffffff>
> <DIV>&nbsp; I saw the sleep command in the python documentation and =
> tried to use=20
> it - but no matter how hard I try I get an error saying the variable =
> 'sleep'=20
> does not exist.&nbsp; Help!</DIV></BODY></HTML>
>
> ------=_NextPart_000_0040_01C04140.DA25DA00--
>
> --__--__--
>
> Message: 6
> From: Doug Stanfield <DOUGS@oceanic.com>
> To: 'wheelege' <wheelege@tsn.cc>, tutor@python.org
> Subject: RE: [Tutor] really really silly question
> Date: Sat, 28 Oct 2000 04:57:07 -1000
>
> There are no silly or stupid questions in this group.  Feel free to ask
> away.
>
> >  I saw the sleep command in the python documentation
> > and tried to use it - but no matter how hard I try I
> > get an error saying the variable 'sleep' does not exist.
>
> Sleep is a part of the time module.  That means time has to be imported
> before sleep will be recognized as a valid name.  Here's an example
>
> #!/usr/bin/env python
> import time
>
> print "The beginning of time."
> time.sleep(5.9) # not sure the documents mention that fractions work too
> print "The end of time."
>
> > Help!
>
> Hope this did.
>
> -Doug-
>
> --__--__--
>
> Message: 7
> From: "wheelege" <wheelege@tsn.cc>
> To: <tutor@python.org>
> Subject: Re: [Tutor] really really silly question
> Date: Sun, 29 Oct 2000 03:01:20 +1100
>
> Thanks alot.
>
> Floating point integers work in the sleep function, otherwise I wouldn't be
> able to use it.  I'm making an arkanoid game - it's going pretty cool right
> now, and I am learning alot.
>
> Hope everyone can bear with me :)
>
> Glen
>
> --__--__--
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://www.python.org/mailman/listinfo/tutor
>
> End of Tutor Digest

--
Thank you and have a great day

Jerry Killion
Director - Client Services
MIPS Corporation
2 Clinton Square
Syracuse, NY 13202