コールpymysql.escape_string(「データベースのデータを挿入」)
例えば:
輸入pymysql
STR =「"自衛隊として」
印刷(pymysql.escape_string(STR))