การจับเวลาด้วย Python
ตัวอย่างการใช้ฟังก์ชั่น clock() and time() บน Windows and Linux Run on linux >>> from time import clock, time >>> print clock(), time() 0.01 1169573460.96 >>> print clock(),...
View ArticleQR Code: in Python
pyqrcode Project site at: http://pyqrcode.sourceforge.net/ Download source code: http://downloads.sourceforge.net/pyqrcode/pyqrcode-0.2.1.tar.gz?use_mirror= Install from sourcecode on Ubuntu 10.04 $...
View ArticleQR Code: in Python
libpng12-0 libpng12-dev pkg-config Install libqrencode http://fukuchi.org/works/qrencode/index.en.html Libqrencode is a C library for encoding data in a QR Code symbol, a kind of 2D symbology that can...
View ArticlePython: converting datetime to POSIX time
Python: converting datetime to POSIX time import time, datetime d = datetime.datetime.now() print time.mktime(d.timetuple()) Python: converting POSIX time to datetime import datetime...
View ArticlePython & command line
ตัวอย่างคำสั่งการ Import แบบ command line โดยที่ยังไม่ต้องเข้าไปที่ shell ของ python python -c "import MySQLdb"
View ArticleInstall MySQLdb for Python
Download and install MySQL package installer Download MySQLdb mysql-python (1.2.3) Install MySQLdb ARCHFLAGS=’-arch x86_64′ python setup.py build ARCHFLAGS=’-arch x86_64′ python setup.py install If you...
View ArticleWriting MySQL Scripts with Python DB-API
import MySQLdb conn = MySQLdb.connect (host = "localhost", user = "testuser", passwd = "testpass", db = "test") cursor = conn.cursor () cursor.execute ("SELECT VERSION()") row = cursor.fetchone ()...
View Articleตรวจสอบหารายชื่อ email จาก text
import re email = re.findall("\w+\@\w+\.\w+", text) if m: print m # return list ที่มา: http://docs.python.org/library/re.html
View ArticleS_ISDIR
S_ISDIR S_ISDIR checks the file mode m to see whether the file is a directory. If so it returns True freepascal.org #ifndef S_ISDIR #define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR) #endif #ifndef...
View Articleการติดตั้ง numpy บน Python 2.7
อัพเกรด pip ให้เป็นเวอร์ชันล่าสุด > cd c:\Python27 > python -m pip install --upgrade pip Collecting pip Downloading pip-9.0.2-py2.py3-none-any.whl (1.4MB) 100% |################################|...
View ArticleChatterBot
หัวข้อ ติดตั้ง ChatterBot จาก PyPi ตรวจสอบเวอร์ชันที่ติดตั้ง การอัพเกรดให้เป็นเวอร์ชันล่าสุด ทดลองสร้าง chat bot สร้าง chat bot รองรับภาษาไทย 1. ติดตั้ง ChatterBot จาก PyPi pip install chatterbot 2....
View ArticleChatterBot Tutorial
หัวข้อ Read only mode Setting the storage adapter Input and output adapters Specifying logic adapters Getting a response from your chat bot 1. Read only mode Your chat bot will learn based on each new...
View Article
More Pages to Explore .....