Questions tagged [printing]

Printing is a process for reproducing text and images, typically with ink or toner, on paper. For programming questions related to 3D-printing, please, use [3d-printing] tag.

Printing is a process for reproducing text and images. Both ink and toner are commonly used, with the latter being used for laser printers.

It can also refer to printing text to stdout on a terminal, e.g., the printf function in C or the print construct in PHP.

For programming questions related to 3D-printing, general questions can be asked on https://3dprinting.stackexchange.com/.

23212 questions
366
votes
22 answers

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 is: 1 2 3 4 . . . How get this to instead look…
Pol
  • 24,517
  • 28
  • 74
  • 95
355
votes
9 answers

Show DataFrame as table in iPython Notebook

I am using iPython notebook. When I do this: df I get a beautiful table with cells. However, if i do this: df1 df2 it doesn't print the first beautiful table. If I try this: print df1 print df2 It prints out the table in a different format…
Chris
  • 12,900
  • 12
  • 43
  • 65
350
votes
14 answers

Can I force a page break in HTML printing?

I'm making a HTML report that is going to be printable, and it has "sections" that should start in a new page. Is there any way to put something in the HTML/CSS that will signal to the browser that it needs to force a page break (start a new page)…
Daniel Magliola
  • 30,898
  • 61
  • 164
  • 243
311
votes
13 answers

How to deal with page breaks when printing a large HTML table

I have a project which requires printing an HTML table with many rows. My problem is the way the table is printed over multiple page. It will sometimes cut a row in half, making it unreadable because one half is on the bleeding edge of a page and…
h3.
  • 10,688
  • 15
  • 51
  • 54
309
votes
22 answers

Background color not showing in print preview

I am trying to print a page. In that page I have given a table a background color. When I view the print preview in chrome its not taking on the background color property... So I tried this property: -webkit-print-color-adjust: exact; but still…
user2045025
306
votes
7 answers

Need to remove href values when printing in Chrome

I'm attempting to customize the print CSS, and finding that it prints links out with the href value as well as the link. This is in Chrome. For this HTML: Google It prints: Google (http://www.google.com) And I…
Chris Gratigny
  • 3,223
  • 2
  • 16
  • 7
304
votes
18 answers

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 amongst browsers.
doekman
  • 18,750
  • 20
  • 65
  • 86
299
votes
2 answers

How do I change the string representation of a Python class?

In Java, I can override the toString() method of my class. Then Java's print function prints the string representation of the object defined by its toString(). Is there a Python equivalent to Java's toString()? For example, I have a PlayCard class.…
snakile
  • 52,936
  • 62
  • 169
  • 241
299
votes
3 answers

CSS to set A4 paper size

I need simulate an A4 paper in web and allow to print this page as it is show on browser (Chrome, specifically). I set the element size to 21cm x 29.7cm, but when I send to print (or print preview) it clip my page. See this Live example! body { …
David Rodrigues
  • 12,041
  • 16
  • 62
  • 90
281
votes
18 answers

How can I print multiple things on the same line, one at a time?

I want to run a script, which basically shows an output like this: Installing XXX... [DONE] Currently, I print Installing XXX... first and then I print [DONE]. How can I instead print Installing xxx... and [DONE] on the same…
user697108
  • 3,521
  • 3
  • 20
  • 14
268
votes
12 answers

CSS Printing: Avoiding cut-in-half DIVs between pages?

I'm writing a plug-in for a piece of software that takes a big collection of items and pops them into HTML in a WebView in Cocoa (which uses WebKit as its renderer, so basically you can assume this HTML file is being opened in Safari). The DIVs it…
joeylange
  • 2,873
  • 2
  • 17
  • 7
260
votes
17 answers

How can I print bold text in Python?

E.g: print "hello" What should I do to make the text "hello" bold?
Jia-Luo
  • 3,023
  • 5
  • 16
  • 17
259
votes
13 answers

Print JSON parsed object?

I've got a javascript object which has been JSON parsed using JSON.parse I now want to print the object so I can debug it (something is going wrong with the function). When I do the following... for (property in obj) { output += property + ': '…
Skizit
  • 43,506
  • 91
  • 209
  • 269
257
votes
6 answers

How do I flush the PRINT buffer in TSQL?

I have a very long-running stored procedure in SQL Server 2005 that I'm trying to debug, and I'm using the 'print' command to do it. The problem is, I'm only getting the messages back from SQL Server at the very end of my sproc - I'd like to be able…
Erik Forbes
  • 35,357
  • 27
  • 98
  • 122
247
votes
8 answers

Print string and variable contents on the same line in R

Is there a way to print text and variable contents on the same line? For example, wd <- getwd() print("Current working dir: ", wd) I couldn't find anything about the syntax that would allow me to do this.
user2015601