Posts

Showing posts with the label printing

Why does it say “Invalid Syntax” When I try to print something in Python? [duplicate]

Why does it say “Invalid Syntax” When I try to print something in Python? [duplicate] This question already has an answer here: When I try to run my Python code in Idle (on a Mac), is says 'invalid syntax' On my quotation marks. Does anyone know why? from goto import goto, label import random tries = 0 r = int(100 * random.random()) + 1 label .guess guess = int(raw_input("Please guess the number between 1 - 100: ")) if guess == r: tries += 1 print "You are correct! It took you " + str(tries) + " tries!" if guess > r: print"Too high... Try again" tries += 1 goto .guess if guess < r: print"Too low... Try again." tries += 1 goto .guess exit Does any one know why this might not work? The line that has an error is this one: print "You are correct! It took you " + str(tries) + " tries!" It is the second quotation mark. This question has been asked before and already has an ...

Paging still visible in print page of the table c#

Paging still visible in print page of the table c# I have a table with paging but I would like to print the whole table. I disable it in the code behind, execute the print function and re enable paging. However it seems that the c# code executes quicker then the actual print is executed or the print page is rendered and the table is still visible with paging. Here is the code: mainGrid.AllowPaging = false; ClientScript.RegisterStartupScript(this.GetType(), "msg", "printME();"); mainGrid.AllowPaging = true; ////////////////////////////////////////////////////////////////////////////// function printME() { window.print(); } What would be the solution - setting the timer? The event is triggered by a button so on click is does everything at once and the print page is not rendered correctly... Any solutions? – whiterabbitj Jun 29 at 10:20 ...

How to print the text right aligned in a Bluetooth POS Printer?

How to print the text right aligned in a Bluetooth POS Printer? I have been trying to do a POS app in android where I am printing the receipt on a Bluetooth printer connected to the app. I am able to print 'large', 'small' and QR code with the HOINSDK provided with the device and also I am able to align then 'left' and 'centre' but unable to align it to the 'right'. Any help is appreciated. Below are the codes for respective things: //For Large Text cmd[0] = 27; cmd[1] = 97; cmd[2] &= 0xEF; mService.write(cmd); mService.sendMessage("" + large_txt.getText().toString(), "GBK"); //For Small Text cmd[0] = 0x1b; cmd[1] = 0x21; cmd[2] &= 0xEF; mService.write(cmd); mService.sendMessage("" + small_txt.getText().toString(), "GBK"); //For Cent...