Python implementation of vertical printing flyers mobile phone number easy to tear strip

  • 2020-04-02 14:41:34
  • OfStack

Using python 2.7, beginners, the code is relatively simple.

NumPrinter. Py


#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
    @Author:Quico Tomy
    @Function:Input a phone number and print by line
    @Demo Time:2015-3-16
'''
numstr = raw_input("Input number: ")
num = list(numstr)
 
f = open('num.doc', 'a')
for i in range(11):
    for j in range(9):
        f.write(num[i] + 'tt')
    f.write(num[i] + 'n')
 
f.close()

That's all I'm going to share with you, and I hope you enjoy it.


Related articles: