[Tutor] command for clearing user screen input

Gopinath V, ASDC Chennai gopinathv at hcltech.com
Mon Mar 14 04:44:18 CET 2005


HI all,
   I'm trying a series of inputs ...i need to get the screen cleared after
every 5 inputs...can any 1 tell me how do I do it

-----Original Message-----
From: tutor-request at python.org [mailto:tutor-request at python.org] 
Sent: Sunday, March 13, 2005 4:31 PM
To: tutor at python.org
Subject: Tutor Digest, Vol 13, Issue 36

Send Tutor mailing list submissions to
	tutor at python.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://mail.python.org/mailman/listinfo/tutor
or, via email, send a message with subject or body 'help' to
	tutor-request at python.org

You can reach the person managing the list at
	tutor-owner at 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: Code example (Alan Gauld)
   2. Re: Whats so good about OOP ? (Alan Gauld)
   3. Re: Whats so good about OOP ? (Sean Perry)
   4. Re: Whats so good about OOP ? (Sean Perry)
   5. help (Jeff420harris00 at wmconnect.com)


----------------------------------------------------------------------

Message: 1
Date: Sun, 13 Mar 2005 00:27:42 -0000
From: "Alan Gauld" <alan.gauld at freenet.co.uk>
Subject: Re: [Tutor] Code example
To: "Mike Wagman" <mwagman at charter.net>, <tutor at python.org>
Message-ID: <002301c52763$790a4950$1ade8751 at xp>
Content-Type: text/plain;	charset="Windows-1252"

> Can someone please show me an example of two programs - you run one
in
> console one - then when you run one in console two - it talks to the
> first program = sending a specific string instructing the first one
to
> close.

Look at the socket examples in the Python web pages.
The sender and receiver programs are exactly what you want.

If you don't understand them come back with more specific
questions

HTH,

Alan G.



------------------------------

Message: 2
Date: Sun, 13 Mar 2005 00:34:58 -0000
From: "Alan Gauld" <alan.gauld at freenet.co.uk>
Subject: Re: [Tutor] Whats so good about OOP ?
To: "Mark Kels" <mark.kels at gmail.com>, <tutor at python.org>
Message-ID: <002801c52764$7cfb1610$1ade8751 at xp>
Content-Type: text/plain;	charset="iso-8859-1"

> Can anyone give me an example for a task that could be done only
with
> OOP or will be much simpler to do with it ?

Anything that can be done in OOP can be done without it.
But OOP makes many things easier.

But OOP only really becomes useful in bigger programs. If your biggest
program is less than 100 lines of code then you probably haven't hit
the kinds of problems that OOP solves. Between 100 and 1000 lines you
increasingly hit problems of complexity, name collisions ( two things
with the same name), and writing nearly identical code lots of times.

By the time you get over 1000 lines all of those problems are
compounded
by the fact that you can't actually keep all the details in your head
anymore! Objects help bring some sanity to the procedings.

Finally, once you get your head around the concept of objects being
like little independant programms communicating via messages then they
start to fit certain types of problem very well. THe classic case is
the GUI with each window, doalog box, button, menu etc being
independant objects, but with a lot of common functions and a lot
of inter-communication. When you coule that to the event-driven
style of most GUI toolkits then events translate easily into
inter-object messages and OOP becomes a very natural way to program
GUIs.

HTH,

Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld



------------------------------

Message: 3
Date: Sat, 12 Mar 2005 23:49:28 -0800
From: Sean Perry <shaleh at speakeasy.net>
Subject: Re: [Tutor] Whats so good about OOP ?
To: tutor at python.org
Message-ID: <4233F088.4080508 at speakeasy.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Brian van den Broek wrote:
> 
> 1) Namespace issues
> With procedural (or imperative -- don't know which is the right terms
> for non-OOP code which employs functions) code, you can have issues
> caused by namespaces. Just yesterday, someone on the main python
> list/newsgroup had code something like:
> 

procedural v. OO
imperative v. functional

In an imperative language you tell the computer what to do (imperative):
"put 5 in X, use X in function foo, store foo's result in blah". The 
base component is an imperative statement. If you have not had an 
English grammar class recently imperative sentences are things like 
"You, bring me my supper".

In a functional language, the base item is a function.

foo(X(blah())) or for the lispy people (foo (x (blah))).

You could do OO in a functional language. Haskell for instance has a 
concept of classes, user defined types, polymorphism, etc.

The point is, these are two axes on the programming language chart.

procedural, imperative -> C
OO, functional -> OCaml (close enough anyways)


------------------------------

Message: 4
Date: Sat, 12 Mar 2005 23:57:50 -0800
From: Sean Perry <shaleh at speakeasy.net>
Subject: Re: [Tutor] Whats so good about OOP ?
To: tutor at python.org
Message-ID: <4233F27E.1060907 at speakeasy.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Mark Kels wrote:
> Hi list !
> I want to know whats so great in OOP...
> I have learned some of it, but I don't understand why everybody like
> it so much...
> Can anyone give me an example for a task that could be done only with
> OOP or will be much simpler to do with it ?
> 
> Thanks in advance.
> 

Other commenters on this thread have covered OO fairly well. I have one 
clarification detail to add.

In procedural code, you spend a lot of time micromanaging:

put that there
blah + quz is bar
etc

In OO code, you tell each object how to handle its data. Then your 
actual program just becomes a bunch of requests for objects to talk to 
each other. I know, you are thinking that is how your procedural code 
works today. But as you program, look at how much time you are telling 
the pieces what their jobs are and how much time you spend telling 
pieces to do their jobs.

For further knowledge, read the Design Patterns book. It will seem like 
obvious, simple ideas you already know. It did for me. It is not until 
you start talking to other people that you realize what you learned. I 
am currently reading Holub's "On Patterns". He hammers OO ideas home 
pretty well.

As Alan Gauld said, OO does not really start to shine until you reach a 
certain level of complexity. It takes most people quite a while to 
really get into the mindset. Take it slow, get it wrong, do it again (-: 
We all have.


------------------------------

Message: 5
Date: Fri, 11 Mar 2005 19:47:57 EST
From: Jeff420harris00 at wmconnect.com
Subject: [Tutor] help
To: tutor at python.org
Message-ID: <13f.ef2562d.2f63963d at wmconnect.com>
Content-Type: text/plain; charset="us-ascii"


    ok i have learned that on the python shell or new window you can type 
in......>>>print "hello world"...and the output is ..'hello world'.. or you
can 
put in anything realy and it say it back to you.....is this a program or
what 
and what is the purpose of this can you realy use this for any thing other
then 
it just saying it back. if this is not a program please teach me what is a 
program and what i need to know to write them and if this is a program teach
me 
how to write better programs i can use outside of the python shell...and i 
have been reading and reading web pages and they talk about languges and
things 
but i have yet to see any languges or anything to teach me the 
languges....please help me....THANK YOU ALL VERY MUCH !!!!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://mail.python.org/pipermail/tutor/attachments/20050311/dbb754f2/attachm
ent.htm

------------------------------

_______________________________________________
Tutor maillist  -  Tutor at python.org
http://mail.python.org/mailman/listinfo/tutor


End of Tutor Digest, Vol 13, Issue 36
*************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050314/fcf36836/attachment.htm


More information about the Tutor mailing list