PHP+Python,轻量维护超轻松
Posted Yiven
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP+Python,轻量维护超轻松相关的知识,希望对你有一定的参考价值。
window下安装Python
直接去Python官网下载msi安装程序安装即可(选择自定义安装才能修改程序安装路径哦)
widows下Python的数据库访问模块PyMysql的安装
1.open the cmd execute the following command or enter "cmd /k "cd PythonScriptPath"" to a batch file and execute the batch please replace the "PythonScriptPath" for your PythonScriptPath C:> cd PythonScriptPath 2.use pip to install the pymysql C:> python pip.exe install pyMysql
demo for use pymysql in cmd
命令执行的返回结果已省略
C:>python >>> import pymysql >>> conn = pymysql.connect(host="localhost",user="root",password="root",db="test",charset="utf8mb4") >>> cursor = conn.cursor() >>> row = cursor.execute("select version()") >>> print (row) >>> result = cursor.fetchone() >>> print (result) >>> cursor.close() >>> exit()
windows下PHP的Python扩展PPython的安装
到这里下载,里面有详细的使用说明:https://download.csdn.net/download/vancevol/10696481
以上是关于PHP+Python,轻量维护超轻松的主要内容,如果未能解决你的问题,请参考以下文章
YYDS!Dexplot:一行 Python 代码轻松绘制统计图表!