All Questions

1380
votes
25answers
1512251 views

What's the simplest way to print a Java array?

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + @ + the hex of the hashCode of the array, as defined by Object.toString(): int[] intArray = new...
791
votes
14answers
472885 views

How to flush output of Python print?

How do I force Python's print function to output to the screen? This is not a duplicate of Disable output buffering - the linked question is attempting unbuffered output, while this is more general. ...
373
votes
13answers
299130 views

How to use HTML to print header and footer on every printed page of a document?

Is it possible to print HTML pages with custom headers and footers on each printed page? I'd like to add the word "UNCLASSIFIED" in Red, Arial, size 16pt to the top and bottom of every printed page, ...
320
votes
24answers
497285 views

Print <div id="printarea"></div> only?

How do I print the indicated div (without manually disabling all other content on the page)? I want to avoid a new preview dialog, so creating a new window with this content is not useful. The page ...
237
votes
22answers
496817 views

Print the contents of a DIV

Whats the best way to print the contents of a DIV?
203
votes
16answers
327927 views

Print in one line dynamically

I would like to make several statements that give standard output without seeing newlines in between statements. Specifically, suppose I have: for item in range(1,100): print item The result i...
204
votes
16answers
212554 views

How do I keep Python print from adding newlines or spaces?

In python, if I say print 'h' I get the letter h and a newline. If I say print 'h', I get the letter h and no newline. If I say print 'h', print 'm', I get the letter h, a space, and the l...
157
votes
6answers
169418 views

Why doesn't "System.out.println" work in Android?

I want to print something in console, so that I can debug it. But for some reason, nothing prints in my Android application. How do I debug then? public class HelloWebview extends Activity { ...
33
votes
12answers
313772 views

Why would you use the return statement in Python?

What is the simple basic explanation of what the return statement is, how to use it in Python? And what is the difference between it and the print statement?
175
votes
13answers
253655 views

Landscape printing from HTML

I have a HTML report, which needs to be printed landscape because of the many columns. It there a way to do this, without the user having to change the document settings? And what are the options amo...

Previous Next