Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“打印”;C:\Users>&引用;用python_Python - Fatal编程技术网

“打印”;C:\Users>&引用;用python

“打印”;C:\Users>&引用;用python,python,Python,我有以下代码: print("C:\Users>") 我想让python打印C:\Users>,但我得到了以下错误: SyntaxError: EOL while scanning string literal 现在,我想问题是python正试图到达我计算机上的位置。 我如何避免它 我正在使用python 3.7尝试运行: print(r"C:\Users>") # this will make it a raw string, so it

我有以下代码:

print("C:\Users>")
我想让python打印C:\Users>,但我得到了以下错误:

SyntaxError: EOL while scanning string literal
现在,我想问题是python正试图到达我计算机上的位置。 我如何避免它

我正在使用python 3.7

尝试运行:

print(r"C:\Users>") # this will make it a raw string, so it will not care about any backslashes (or you can just make it 2 backslashes so it will print one backslash like this: print('C:\Users>')

打印(“C:\\Users>”)
它可以工作!谢谢你,伙计!