Python3使用内置CSV模块读写CSV格式文件 January 10, 2018 ```python import csv # open的时候可以指定编码 csv_reader = csv.reader(open('1.csv')) csv_writer = csv.writer(open('2.csv','w')) for row in csv_reader: print(row) # ['公告编号', '公告内容', ...] csv_writer.writerow(row) # 还有writerows方法 # csv_writer.writerows(rows) ```
并发更新数据的思想 January 8, 2018 ### Java代码: ```java while ( true ) { if ( null != upCount && 0 < upCount ) { break; } UserInfoDO newUserInfo = userInfoDAO.getById(userInfoDO.getId()); upCount = userInfoDAO.updateFollowerNumDesc(newUserInfo); } ``` ### SQL代码: ```xml update user_center set gmt_modified=now(),total_follower_num=total_follower_num + 1 where id=#id# total_follower_num=#totalFollowerNum# ```