Skip to content

Commit 5be83a8

Browse files
committed
Fix note
1 parent bb08cd3 commit 5be83a8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎Drake-Z/0002/0002.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def write_to_mysql(filename):
1414
cursor.execute('create table user (id varchar(20) primary key, name varchar(20))')
1515
f = open(filename, 'r').readlines()
1616
for line, num in zip(f, range(1, len(f)+1)):
17-
line = line[:-1] #直接除去最后一个字符的所有字符,这里去除\n符号
17+
line = line[:-1] #去除\n符号
1818
cursor.execute('insert into user (id, name) values (%s, %s)', [str(num), line])
1919
conn.commit()
2020
cursor.close()

0 commit comments

Comments
 (0)