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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM