python中实现打印特定字符变换

首先需要将 lib文件 放在该文件同一目录

使用的时候,先导入 from lib.common import print_msg ,然后调用里面的 print_msg() 方法即可!

lib文件地址:https://download.csdn.net/download/qq_36119192/11152629

python2和python3皆可用!

示例:

test.py文件内容

# -*- coding: utf-8 -*-
"""
Created on Mon Apr 29 18:30:35 2019
@author: 小谢
"""
from lib.common import print_msg
import time
for i in range(101):
    a=str(i)
    time.sleep(1)
    msg="%s found!"%a
    print_msg(msg)

原文地址:https://www.cnblogs.com/csnd/p/11807683.html