Giter VIP home page Giter VIP logo

ppython's Introduction

ppython

Automatically exported from code.google.com/p/ppython

程序结构: php_python.py : python 的主控文件,启动该文件会开启一个socket,等待连接处理。 php_python.php : php的交互文件,用来跟python通讯的模块文件 process.py : 核心处理文件,该文件处理php端传送过来的命令并分线程进行处理。

创建一个test.py 内容如下 #!/usr/bin/env python3 #coding=utf-8 import MySQLdb def go() : conn=MySQLdb.connect(host='localhost', user='root', passwd='123456', db='test') ; cur=conn.cursor(); sql="show tables;" cur.execute(sql); r=cur.fetchall();

return r

创建一个test.php 内容如下:

先启动 python3 php_python.py

就可以测试 php test.php

============ php端程序


Python端程序,文件名testModule.py

-- coding: UTF-8 --

def add(a, b): return a + b

ppython's People

Contributors

budzhang avatar whittmy avatar

Stargazers

51itclub avatar

Watchers

James Cloos avatar

Forkers

51itclub

ppython's Issues

Python3.4 is works!

I used Python3.4,first time,it don't work.
It always show error message "'cp950' codec can't encode character '\u957f' in 
position 2: illegal multibyte sequence".

So,I tested and seek, find the KEY is  "Simplified Chinese"!
such like, "process.py" in line 160 "print("消息长度:%d" % totalLen)",
you should change to "print("Message length:%d" % totalLen)",
and it works!.

So, I put all the Simplified Chinese to English.
enjoy it!

Original issue reported on code.google.com by [email protected] on 28 Apr 2015 at 2:01

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.