บทความ

Python : Text to speak(Google)

step 1. py -m pip install gtts py -m pip install pyglet step 2. โหลด AVbin มาติดตั้ง http://avbin.github.io/AVbin/Download.html step 3 ลองรัน #code: #--------------------------------------------------------------------- from gtts import gTTS from time import sleep import os import pyglet   tts = gTTS(text='สวัสดีคุณผู้ชาย มีอะไรให้ออเจ้ารับใช้คะ', lang='th') #ต้องมีการสร้างโฟลเดอร์ tmp ไว้ใน drive C: ก่อน filename = 'C:\\tmp\\gtts.mp3' tts.save(filename) music = pyglet.media.load(filename, streaming=False) music.play() sleep(music.duration) #prevent from killing os.remove(filename) #remove temperory file #---------------------------------------------------------------------

Python: tensorflow + openCV to exe

ปัญหากับ windows 10 -64bit ต้อง upgrade matplotlib ให้เป็น version 3.0.2 ขั้นไป ด้วยคำสั่ง  py -m pip install -U matplotlib และ downgrade pandas ลงมาให้เป็น v 0.23.0 ด้วย  ไม่งั้นเกิด tf.estimator package not installed ref: https://github.com/tensorflow/tensorflow/issues/23007 ปัญหาถัดมาคือ tensorflow module not found แก้ด้วยการเปลี่ยนชื่อไฟล์ โดยการเติม  tensorflow.python. นำหน้าชื่อไฟล์เดิมคือ  _pywrap_tensorflow_internal.pyd ref: https://stackoverflow.com/questions/49732801/windows-10-pyinstaller-tensorflow-missing-modules/50580345 ----------

python : Levenshtein วัดความเหมือนของคำ

# install with: pip install python-Levenshtein from Levenshtein import distance edit_dist = distance ( "ชลิตา" , "ชาริตา" ) https://www.youtube.com/watch?v=b6AGUjqIPsA&fbclid=IwAR3B6Ihq9yk1S9eNXNoQF4IMRXhd-srbsSjsEdDcbEaBVRpsmsGvExHqAE0

MQTT : ใช้ผ่านหน้าเว็บด้วย Web Socket โดยใช้ mqttws.js

http://www.steves-internet-guide.com/using-javascript-mqtt-client-websockets/ ภาษาไทย เข้าใจง่าย https://ioxhop.github.io/ESPIOX2-Document/mqtt-on-adurino-ide.html Src ของไทย : https://www.dropbox.com/s/b2rromz9ijg9puh/mqtt_html.zip?dl=0
  อันตราย อาจทำให้เข้า raspberry pi ไม่ได้ ติดอยู่หน้า login https://www.raspberrypi-spy.co.uk/2015/02/how-to-autorun-a-python-script-on-raspberry-pi-boot/ อย่าเอาอะไรไปใส่ ใน /ect/profile จะดีกว่า เว็บบนมันหลอก

scikit-learn : decision tree Dependency

ติดตั้ง , set part var , restart หรือ import os แล้ว append https://stackoverflow.com/questions/35064304/runtimeerror-make-sure-the-graphviz-executables-are-on-your-systems-path-aft Graphviz ใช้ในการสร้างภาพ graph จาก graph/tree data

scikit-learn : รัน jupyter notebook แล้วเกิด ImportError: DLL load failed: The specified module could not be found.

รูปภาพ
ปัญหา ImportError : DLL load failed: The specified module could not be found. ปัญหานี้เกิดจากการ install แค่เพียง numpy วิธีการ ให้ uninstall numpy แล้วไป download numpy+mkl.whl เช่น (numpy‑1.15.4+mkl‑cp36‑cp36m‑win_amd64.whl *ขึ้นกับ pythonVersion) ได้ที่ https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy จากนั้นก็ ติดตั้งไฟล์ .whl ด้วยคำสั่ง pip ก็จะสามารถใช้งานได้ปกติ