How do I escape forward slashes in python, so that open() sees my file as a filename to write, instead of a filepath to read?

前端 未结 3 1167
野性不改
野性不改 2021-02-13 04:46

Let me preface this by saying I\'m not exactly sure what is happening with my code; I\'m fairly new to programming.

I\'ve been working on creating an i

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-13 05:28

    Related to the title of the question, though not the specifics, if you really want your file names to include something that looks like a slash, you can use the unicode character "∕" (DIVISION SLASH), aka u'\u2215'.

    This isn't useful in most circumstances (and could be confusing), but can be useful when the standard nomenclature for a concept you wish to include in a filename includes slashes.

提交回复
热议问题