I know there's tons of libraries out there that does this for you, but I want to know if there's any simple way that's built in.   So far I'm just doing os.system('clear'). This works, but the 'clear' command only inserts a bunch of newlines instead of actually clearing the whole screen.  This is fine for animations that aren't very big, but for animations that cover up more than 1 screen worth of space, it will start scrolling up and down.
Like most Python developers, I typically keep a console window open with the Python interpreter running to test commands, dir() stuff, help() stuff, etc.  Like any console, after a while the visible backlog of past commands and prints gets to be cluttered, and sometimes confusing when re-running the same command several times.  I'm wondering if, and how, to clear the Python interpreter console.  I've heard about doing a system call and either calling cls on Windows or clear on Linux, but I was hoping there was something I could command the interpreter itself to do.  Note: I'm running on Windows, so Ctrl+L doesn't work.
I have text file. Task - get first and last line from file after   $ cat file | grep -E "1|2|3|4" | commandtoprint  $ cat file 1 2 3 4 5   Need this without cat output (only 1 and 5).  ~$ cat file | tee &gt;(head -n 1) &gt;(wc -l) 1 2 3 4 5 5 1   Maybe awk and more shorter solution exist... the cop (who's) escorting him One of the cops escorts Tim out of the house and toward a police car. Curious neighbors have gathered outside. Tim spits on the cop (who's) escorting him.   Is &quot;escorts&quot; the more natural choice of verb to use in this context?  Is the emboldened sentence phrased naturally without adding &quot;who's&quot;? if $a,b$ are nilpotent elements of a commutative ring $R$, show that $a+b$ is also nilpotent $R$ is commutative, $I$,$J$ are ideals, $I+J=R$, then $IJ=I\cap J$ If $R$ is a commutative ring and $I$ and $J$ are ideals s.t. $I+J=R$ then show that $IJ=I\cap J$.  I've already shown that $IJ \subset I\cap J$, now I need to show the reverse inclusion.   I'm a bit lost, so far i'm just figuring out what pieces I have to work with.  Such as:  $\forall r\in R$ $\exists i\in I ,j\in J$ s.t. $i+j=r$  $\forall ij\in IJ$, $ij=i_1$ and $ij=j_1$ for some $i_1\in I$, $j_1\in J$.  Also, if I let $x\in I\cap J$, then $x=i_2=j_2=i+j$ for some $i_2\in I$, $j_2\in J$  Anyone, having problem getting to the conclusion here, thanks in advance I am using Ubuntu 12.10.  Please outline the different ways I can upgrade to 13.04. What rules govern forced removal from flights (due to overbooking)? I was recently surprised to see  because his flight was overbooked.  He was reportedly a doctor who needed to see patients the next morning, so he did not really want to get off, justifying the use of force.  I knew that airlines could overbook flights and deny boarding to some passengers, but I thought that kind of boarding denial would happen at the gate and that once folks had been let on, those denied boarding would be those arriving later to the gate.    Why or in what conditions is this kind of forcible removal considered OK?    Clarification following close votes from people who think this question is primarily opinion-based: By "OK" I mean the sense of "legally OK," "officially accepted," "instantiated as policy," "sanctioned by authorities," or "OK according to the regulations and policies and laws and whatever other formal rules govern forced removal from flights due to overbooking." Whether or not you personally consider it socially acceptable does not matter as an answer, unless you have formalized that into a citeable adopted form that governs what happens and want to explain the reasoning behind that rule. Finding $ \int^1_0 \frac{\ln(1+x)}{x}dx$ There is supposed to be a clean solution to the integral below, maybe involving some symmetry $$ \int^1_0 \frac{\ln(1+x)}{x}dx$$ I have tried integration by parts as followed: $\ln(x+1)=u$ ,$\frac{1}{x+1} dx = du$ and also $\frac{1}{x}dx=dv$, $\ln(x)=v$. Then, the integral becomes $$\int^1_0 \frac{\ln(1+x)}{x}dx=- \int^1_0 \frac{\ln x}{1+x}dx$$ which does not make this easier. I have also tried using the identity $\int_a^bf(x)~dx=\int_a^bf(a+b-x)~dx$. So let $I = \int^1_0 \frac{\ln(1+x)}{x}dx$ and also $I = \int^1_0 \frac{\ln(2-x)}{1-x}  $. Then $$2I= \int^1_0 \ln(1+x)+\ln(2-x)$$ which is not any easier, either. Any ideas? :) “All you have to do is read” vs. “All you have to do is to read” I was speaking to an English learner and said, “All you have to do is read a lot.” And they thought that sentence wasn’t grammatically correct because I dropped the word to between is and read.  They thought it should be “All you have to do is to read a lot.” That sounds weird to me.   How do I explain to them the reason you drop the to? Or am I incorrect and it really should have a to? Can "firstly" be used in the same meaning as "at first/initially"? I've come across many sources claiming that the words firstly and first (as an adverb) can be used interchangeably. They, however, only seemed to be comparing their meanings with regard to enumerations - first(ly) I want to say ..., second(ly) ..., last(ly) ...  What bothers me more is if the word firstly is also usable within the meaning of at first or initially like in the sentence:     Muons (subatomic particles) were firstly observed in cosmic rays.   The word first fits there very well, but is that the case for firstly too? I have not found a dictionary definition or example saying so. Verify that $4(29!)+5!$ is divisible by $31$. What is the difference between implication symbols: $\rightarrow$ and $\Rightarrow$? Can I fetch the value of a non-standard CSS property via Javascript? I am trying to read a custom (non-standard) CSS property, set in a stylesheet (not the inline style attribute) and get its value. Take this CSS for example:  #someElement {   foo: 'bar'; }   I have managed to get its value with the currentStyle property in IE7:  var element = document.getElementById('someElement'); var val = element.currentStyle.foo;   But currentStyle is MS-specific. So I tried getComputedStyle() in Firefox 3 and Safari 3:  var val = getComputedStyle(element,null).foo;   ...and it returns undefined. Does anyone know a cross-browser way of retreiving a custom CSS property value?  (As you might have noticed, this isn't valid CSS. But it should work as long as the value follows the correct syntax. A better property name would be "-myNameSpace-foo" or something.) Guess the formula for $\sum\frac 1{(4n-3)(4n+1)}$ and prove by induction Maximum Champion Growth size I was reading about Lulu (new champion) and saw this:     Wild Growth (Ultimate) - Lulu enlarges an ally, knocking enemies away   from them and granting them a large amount of bonus health. For the   next few seconds, that ally gains an aura that slows nearby enemies.   Then I start wondering: what is the max size that a champion reach ? Is there a Maximum size ?  Example: Cho'Gath's Feast +  +  + Wild Growth + Something that make champions grow in size. Cho'Gath will grow every time ? or it will stop at some point ? Is a string literal in c++ created in static memory and destroyed only when the program exits? What do you call a person who is utterly independent and a loner? My attempt at value initialization is interpreted as a function declaration, and why doesn't A a(()); solve it? Send mail without MFMailComposeViewController Characterization convex function. Let $f:[0,1]\rightarrow\mathbb{R}$ be a continuous function such that for all $a,b\in [0,1]$ with $a&lt;b$ $$f\left(\frac{a+b}{2}\right)\leq\frac{1}{b-a}\int_a^b f(x)\,dx.$$ How to prove that $f$ is a convex function? Thank you for your help. If a sequence $(u_n)$ be such that its every subsequence has a subsequence that converges to $0$, then $\lim u_n= 0$