Escaping chars in Python and sqlite

前端 未结 4 2060
温柔的废话
温柔的废话 2020-12-05 06:21

I have a python script that reads raw movie text files into an sqlite database.

I use re.escape(title) to add escape chars into the strings to make them db safe befo

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-05 06:46

    SQLite doesn't support backslash escape sequences. Apostrophes in string literals are indicated by doubling them: '''Allo ''Allo! (1982)'.

    But, like Donal said, you should be using parameters.

提交回复
热议问题