0
零件清單陣列我如何讓Python打印發票
a =list(["CPU,$150.00","RAM ,$120.00","DVD drive $89.00","Hard Disk Drive,$189.99"])
for letter in a:
print(letter)
,這是我的零件清單,我想弄清楚如何得到它打印到打印機的任何提示
零件清單陣列我如何讓Python打印發票
a =list(["CPU,$150.00","RAM ,$120.00","DVD drive $89.00","Hard Disk Drive,$189.99"])
for letter in a:
print(letter)
,這是我的零件清單,我想弄清楚如何得到它打印到打印機的任何提示
從蟒蛇窗口print tutorial:
import win32api
import win32print
def parts_list():
a = ["CPU,$150.00","RAM ,$120.00","DVD drive $89.00","Hard Disk Drive,$189.99"]
with open('printfile.txt', 'w') as f:
for line in a:
f.write(line)
print_windows('printfile.txt')
def print_windows(filename):
win32api.ShellExecute(0, "print", filename, '/d:"%s"' % winn32print.GetDefaultPrinter(),".", 0)
def main():
parts_list()
if __name__ == '__main__':
main()
我需要有輸出打印到打印機謝謝 – trevor 2015-02-24 02:07:06
你檢查[這裏](http://stackoverflow.com/questions/12723818/print-to-standard-printer-from -python) – Marcin 2015-02-24 02:08:24
感謝您的鏈接,我會看到我能做些什麼再次感謝你。 – trevor 2015-02-24 02:13:30