Python实现竖排打印传单手机号码易撕条

yipeiwu_com7年前Python基础

使用python 2.7,初学,代码比较简单。

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] + '\t\t')
    f.write(num[i] + '\n')
 
f.close()

以上就是本文分享给大家的全部内容了,希望大家能够喜欢。

相关文章

解决Python requests 报错方法集锦

python版本和ssl版本都会导致 requests在请求https网站时候会出一些错误,最好使用新版本。 1 Python2.6x use requests 一台老Centos机器上...

python对象转字典的两种实现方式示例

本文实例讲述了python对象转字典的两种实现方式。分享给大家供大家参考,具体如下: 一. 方便但不完美的__dict__ 对象转字典用到的方法为__dict__. 比如对象对象a的属性...

python实现发送和获取手机短信验证码

首先为大家分享python实现发送手机短信验证码后台方法,供大家参考,具体内容如下 1、生成4位数字验证码 def createPhoneCode(session): cha...

linux 下python多线程递归复制文件夹及文件夹中的文件

本文是利用python 复制文件夹 刚开始写了一个普通的递归复制文件夹    然后想了想 觉得对io频繁的程序 threading 线程还比较友好  就写了...

python飞机大战pygame游戏背景设计详解

python飞机大战pygame游戏背景设计详解

本文实例讲述了python飞机大战pygame游戏背景设计。分享给大家供大家参考,具体如下: 目标 背景交替滚动的思路确定 显示游戏背景 01. 背景交替滚动的思路确定 运行 备...