Category : printing

How to count the number of occurrences of the invalid input when the user enter the wrong input. I would like to count how many times the words "invalid input " appears. Here’s my code. Please assist me. while True: number = input("Enter a. number: ") if number.isdigit(): print("The input is valid.") else: print("Invalid input.") ..

Read more

I am solving a question on CodeChef: https://www.codechef.com/SNCKQL21/problems/MAXDISTKT The problem doesn’t really matter, it is more the text cursor in my input/output that is causing a problem. Here is the input: First-line will contain T, the number of test cases. Then the test cases follow. Each test case contains two lines of input. First-line contains ..

Read more

Right now my array prints like this: [[ 1.5531e-01 -4.6594e-02 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00] [-4.6594e-02 1.5531e-01 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00] [ 0.0000e+00 0.0000e+00 4.0381e-01 0.0000e+00 0.0000e+00 0.0000e+00] [-0.0000e+00 -0.0000e+00 -0.0000e+00 1.9826e+03 -5.9479e+02 -0.0000e+00] [ 0.0000e+00 0.0000e+00 0.0000e+00 -5.9479e+02 1.9826e+03 0.0000e+00] [ 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 0.0000e+00 5.1549e+03]] What I would like is: [[ 1.4531e-01 -4.6594e-02 ..

Read more

I need to "talk" with the printer to "get" the information such as out of paper, running out of paper, paper jam, in my code I only receive an array as a return using pyusb. I would be very grateful if someone could help me! import usb.core import usb.util import time dev = usb.core.find(idVendor=0x20d1, idProduct=0x7008) ..

Read more

#this code creates an interface to generate barcodes with a selected printer import barcode import win32api import os from tkinter import * from tkinter import ttk from tkinter import font as tkFont import win32api import win32print import win32ui from glob import glob from PIL import Image, ImageWin from barcode.base import Barcode from barcode.writer import ImageWriter ..

Read more