วิธีการรันโปรแกรม
1. นำไฟล์ที่ต้องการจะประมวลผลไปไว้ที่ directory /home/pongsarkorn/Desktop/rawdata
2. เข้าไปใน directory ที่ไฟล์โค้ดภาษา Python อยู่ ด้วยคำสั่ง cd
3. รันโปรแกรมด้วยคำสั่ง python
4. จะแสดงโค้ด HTML สำหรับ render บน Server ขึ้นมา
และจะมีไฟล์เอาต์พุตเป็น .csv ออกมาที่ directory /home/pongsarkorn/Desktop
สามารถเปิดด้วยโปรแกรม Spreadsheet ได้
6. ใช้คำสั่ง ls ตรวจสอบว่าสามารถทำการ execution ได้ (ชื่อจะเป็นสีเขียว)
7. จำลอง CGI HTTP Server ด้วยคำสั่ง python -m CGIHTTPServer
แหล่งข้อมูล
ฟังก์ชัน
remove_values_from_list สำหรับลบข้อมูลออกจากลิสท์http://stackoverflow.com/questions/1157106/remove-all-occurences-of-a-value-from-a-python-list
ฟังก์ชัน
split()http://www.tutorialspoint.com/python/string_split.htm
คำสั่ง encode HTML ให้สามารถรันเป็นภาษาไทยได้
http://www.w3.org/International/O-charset.th.php
คำสั่งเขียนจาก list ออกไปยังไฟล์ .csv
http://stackoverflow.com/questions/14037540/writing-a-python-list-of-lists-to-a-csv-file








ไม่มีความคิดเห็น:
แสดงความคิดเห็น