Week2 – Getting better

This week, my main tasks were parsing the .dat files and fixing errors in the original database functions. After closely examining some .dat files, I found their format very similar to JSON, which I am quite familiar with. Thus, I only needed to perform some bracket-matching operations.

However, when I tried to port the PHP code to Python, I encountered numerous errors. The issues were due to Python’s need for additional boundary checks on strings and differences in database operations between Pymysql and PHP. Additionally, the original code contains some unnecessary transaction operations. It should only require cursor.execute() instead of using conn.commit() . After making the necessary fixes, I successfully resolved these issues.


Currently, I have replicated most of the main functionalities of the original code. Only a few minor details related to appearance and database exception handling remain, which I plan to address next week.

Leave a Reply

Your email address will not be published. Required fields are marked *