在python 3中遇到ImportError问题.我的项目结构如下:
cts_sap_polaris/
|-- etc
| |-- clean_cts_sap_polaris.yaml
| |-- clean_env_variables.tcl
| |-- cts_sap_polaris_ha_combined.yaml
| |-- cts_sap_polaris.yaml
| `-- TCL_TESTBED_CONFIGS
|-- __init__.py
|-- jobs
| |-- __init__.py
| |-- __pycache__
| | `-- run_cts_sap_polaris.cpython-34.pyc
| `-- run_cts_sap_polaris.py
|-- lib
| |-- cli_check.py
| |-- cts_sap_polaris_utils.py
| |-- __init__.py
| |-- router_show_cts_cmd.py
| |-- router_show_etherchannel_cmd.py
| |-- router_show.py
| |-- utils.py
| |-- validate_show_output.py
| `-- wait_for.py
|-- scripts
| |-- cts_sap_polaris_ha_combined.py
| |-- cts_sap_polaris.py
| |-- __init__.py
| `-- __pycache__ …Run Code Online (Sandbox Code Playgroud) 我有一个字符串,其中包含这样的引号:
string = "\"This is my mom's vase\", said Kevin."
Run Code Online (Sandbox Code Playgroud)
问题是当我将它用作 python 中的字符串时,它会在单引号前添加一个反斜杠,如下所示:
>>> string
'"This is my mom\'s vase", said Kevin.'
>>>
Run Code Online (Sandbox Code Playgroud)
为什么会发生这种情况,我该怎么办?