Python从数据库中读取数据,并打印表格展示数据。

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#----------------------------------------------------------#
# Date    : xxxx-xx-xx                                     #
# Author  : Created by zhouwanchun.                        #
# Wechat  : lovemysql3306                                  #
# Function: This scripts function is ...                   #
# Version : 1.1                                            #
#----------------------------------------------------------#

### Python从数据库中读取数据,并打印表格展示数据。
# 导入模块
import os
import subprocess
import mysql.connector
import myloginpath
import prettytable as pt

# Linux终端清屏
os.system('clear')

# 注释信息
print("""